asdf
This commit is contained in:
4
main.ts
4
main.ts
@@ -27,7 +27,7 @@ Deno.serve({
|
||||
hostname: NET_HOST,
|
||||
port: NET_PORT,
|
||||
onListen: addr => console.log(`Listening on http://${addr.hostname}:${addr.port}`)
|
||||
}, req => {
|
||||
}, (req, addr) => {
|
||||
const notFound = new Response("Not Found. Did you try thinking Miku?", {
|
||||
status: 404,
|
||||
statusText: "Not Found (oo-ee-oo)",
|
||||
@@ -40,7 +40,7 @@ Deno.serve({
|
||||
|
||||
const mapping = mappings.find(val => val.endpoints.some(val => url.pathname === val));
|
||||
|
||||
console.log(`${req.method} ${url.pathname} | mapping exists: ${typeof mapping !== 'undefined'}`);
|
||||
console.log(`${addr.remoteAddr.hostname}:${addr.remoteAddr.port} ${req.method} ${url.pathname} | mapping exists: ${typeof mapping !== 'undefined'}`);
|
||||
return new Promise<Response>(resolve => {
|
||||
if (mapping) {
|
||||
Deno.readFile(path.join(WEB_ROOT, mapping.path)).then(data => {
|
||||
|
||||
Reference in New Issue
Block a user