deno.js to deploy static site

This commit is contained in:
James Feng Cao 2024-03-17 12:23:44 +08:00
parent 22277c08c3
commit 9f8edef028
9 changed files with 26 additions and 17 deletions

9
js/deno.js Normal file
View file

@ -0,0 +1,9 @@
import { serveFile } from "https://deno.land/std/http/file_server.ts";
async function handler(req){
let url = req.url;
let iSlash = url.indexOf('/',11);
let path = url.substring(iSlash+1);
return await serveFile(req, `${Deno.cwd()}/`+path);
};
Deno.serve(handler);