basicAuth
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Add basic auth on top of any http val
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);
To authenticate, paste an api token in the password prompt.
Migrated from folder: Archive/basicAuth
