mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
deno.js to deploy static site
This commit is contained in:
parent
22277c08c3
commit
9f8edef028
9 changed files with 26 additions and 17 deletions
9
js/deno.js
Normal file
9
js/deno.js
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue