mirror of https://github.com/torappinfo/uweb
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
328 B
JavaScript
12 lines
328 B
JavaScript
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);
|
|
if(path.endsWith('/'))
|
|
path = path + 'index.html';
|
|
return await serveFile(req, `${Deno.cwd()}`+path);
|
|
};
|
|
|
|
Deno.serve(handler);
|