Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { isAuthenticated } from "https://esm.town/v/pomdtr/basicAuth";
export default async function(req: Request): Promise<Response> {
if (!await isAuthenticated(req)) {
return new Response("Unauthorized", {
status: 401,
headers: {
"WWW-Authenticate": "Basic",
},
});
}
return new Response("Well played!");
}
stevekrouse-untitled_maroonswallow.web.val.run
December 8, 2023