last fixes hopefully
This commit is contained in:
parent
0dbfd14313
commit
1d3b31532a
@ -23,7 +23,7 @@ if (Deno.args[0] === "prod") {
|
||||
if (!r) req.respondWith(new Response("nope :/", {
|
||||
status: 404
|
||||
}));
|
||||
else req.respondWith(r.toFetchResponse());
|
||||
else await req.respondWith(r.toFetchResponse());
|
||||
}
|
||||
})().catch(console.error);
|
||||
}
|
||||
|
@ -107,7 +107,6 @@ export default class Router {
|
||||
for await (const conn of server) {
|
||||
(async () => {
|
||||
for await (const req of Deno.serveHttp(conn)) {
|
||||
console.log(req.request.url);
|
||||
const r = await this.handle(RestRequest.fromMessage(req));
|
||||
if (r) req.respondWith(r.toFetchResponse());
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ export default function staticHandler(path: string): Handler {
|
||||
await stream.read(new Uint8Array(1));
|
||||
await stream.seek(0, Deno.SeekMode.Start);
|
||||
|
||||
if (i >= 0) res.contentType(realPath.substring(i + 1));
|
||||
return res;
|
||||
if (i >= 0) return res.contentType(realPath.substring(i + 1));
|
||||
else return res;
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user