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 :/", {
|
if (!r) req.respondWith(new Response("nope :/", {
|
||||||
status: 404
|
status: 404
|
||||||
}));
|
}));
|
||||||
else req.respondWith(r.toFetchResponse());
|
else await req.respondWith(r.toFetchResponse());
|
||||||
}
|
}
|
||||||
})().catch(console.error);
|
})().catch(console.error);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,6 @@ export default class Router {
|
|||||||
for await (const conn of server) {
|
for await (const conn of server) {
|
||||||
(async () => {
|
(async () => {
|
||||||
for await (const req of Deno.serveHttp(conn)) {
|
for await (const req of Deno.serveHttp(conn)) {
|
||||||
console.log(req.request.url);
|
|
||||||
const r = await this.handle(RestRequest.fromMessage(req));
|
const r = await this.handle(RestRequest.fromMessage(req));
|
||||||
if (r) req.respondWith(r.toFetchResponse());
|
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.read(new Uint8Array(1));
|
||||||
await stream.seek(0, Deno.SeekMode.Start);
|
await stream.seek(0, Deno.SeekMode.Start);
|
||||||
|
|
||||||
if (i >= 0) res.contentType(realPath.substring(i + 1));
|
if (i >= 0) return res.contentType(realPath.substring(i + 1));
|
||||||
return res;
|
else return res;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e);
|
console.error(e);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user