updates ebrowser
[uweb.git] / js / deno.js
blob33a34908d7e0b3c05c3d343cc501dacc6b870307
1 import { serveFile } from "https://deno.land/std/http/file_server.ts";
2 async function handler(req){
3 let url = req.url;
4 let iSlash = url.indexOf('/',11);
5 let path = url.substring(iSlash);
6 if(path.endsWith('/'))
7 path = path + 'index.html';
8 return await serveFile(req, `${Deno.cwd()}`+path);
9 };
11 Deno.serve(handler);