Public
HTTP (deprecated)
  • pomdtr avatar
    extractValInfo
    @pomdtr
    Extract vals infos (author, name, version) from a val url (either from esm.town or val.town ). Example usage: const {author, name} = extractValInfo(import.meta.url) Also returns a unique slug for the val: <author>/<name>
    Script
  • pomdtr avatar
    readme
    @pomdtr
    An interactive, runnable TypeScript val by pomdtr
    Script
  • pomdtr avatar
    gfm
    @pomdtr
    Markdown to html (with github styling)
    Script
  • pomdtr avatar
    basicAuth
    @pomdtr
    Val Town Basic Auth Add basic auth on top of any http val Usage Wrap your HTTP handler in the basicAuth middleware. import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; function handler(req: Request) { return new Response("You are authenticated!"); } export default basicAuth(handler, { verifyUser: (username, password) => username == "user" && password == "password" }); If you want to use an apiToken as a password: import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; import { verifyToken } from "https://www.val.town/v/pomdtr/verifyToken" function handler(req: Request) { return new Response("You are authenticated!"); } export default basicAuth(handler, { verifyUser: (_, password) => verifyToken(password) });
    Script
  • pomdtr avatar
    api
    @pomdtr
    An interactive, runnable TypeScript val by pomdtr
    Script
1
Next
pomdtr-static.web.val.run
December 31, 2023