mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
bee36a4de8
This makes std/http tests runnable from any directory by spawning test processes in the module directory resolved from import.meta.url and resolving test data relative to the same module directory.
12 lines
292 B
TypeScript
12 lines
292 B
TypeScript
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);
|
|
});
|
|
}
|