Public
HTTP (deprecated)
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
import process from "node:process";
export const secretEndpoint = (req: Request) => {
const secretHeader = req.headers.get("Authorization");
if (secretHeader !== process.env.supersecrettoken)
return new Response("Unauthorized", { status: 401 });
return new Response("My deepest darkest secret");
};
neverstew-secretendpoint.web.val.run
October 23, 2023