Skip to main content
Module

x/basic_auth/demo.ts

Module for performing Basic Auth in Deno Deploy
Latest
File
import { basicAuth } from "./mod.ts";
addEventListener("fetch", (e) => { const unauthorized = basicAuth(e.request, "Access to my site", { "user": "password", }); if (unauthorized) { e.respondWith(unauthorized); return; } e.respondWith(new Response("Your are authorized!"));});