1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 07:08:27 -05:00
denoland-deno/std/http/testdata/file_server_as_library.ts

13 lines
292 B
TypeScript
Raw Normal View History

import { serve } from "../server.ts";
import { serveFile } from "../file_server.ts";
const server = serve({ port: 8000 });
console.log("Server running...");
for await (const req of server) {
serveFile(req, "./testdata/hello.html").then((response) => {
req.respond(response);
});
}