After compiling my script, which runs without any errors, it's supposed to serve index.html. However, when the page is loading, nothing is being sent to the browser.
import { serve } from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="394c5a4afeeff1e3fbf0fef">[email protected]</a>/http/server.ts";
import { serveFile } from 'https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="12474b5541405e49514e50">[email protected]</a>/http/file_server.ts';
const server = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of server) {
console.log(req.url);
if(req.url === '/')
await serveFile(req, 'index.html');
}
Can anyone explain why serveFile isn't functioning properly in this particular case?