mirror of https://github.com/torappinfo/uweb.git
fix deno.js to deploy static site
This commit is contained in:
parent
6e8ede8dd8
commit
8199f16d10
|
@ -2,10 +2,10 @@ import { serveFile } from "https://deno.land/std/http/file_server.ts";
|
||||||
async function handler(req){
|
async function handler(req){
|
||||||
let url = req.url;
|
let url = req.url;
|
||||||
let iSlash = url.indexOf('/',11);
|
let iSlash = url.indexOf('/',11);
|
||||||
let path = url.substring(iSlash+1);
|
let path = url.substring(iSlash);
|
||||||
if(path.endsWith('/'))
|
if(path.endsWith('/'))
|
||||||
path = path + 'index.html';
|
path = path + 'index.html';
|
||||||
return await serveFile(req, `${Deno.cwd()}/`+path);
|
return await serveFile(req, `${Deno.cwd()}`+path);
|
||||||
};
|
};
|
||||||
|
|
||||||
Deno.serve(handler);
|
Deno.serve(handler);
|
||||||
|
|
Loading…
Reference in New Issue