mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
11 lines
310 B
TypeScript
11 lines
310 B
TypeScript
import http from "node:http";
|
|
import { text } from "node:stream/consumers";
|
|
|
|
function request(url: string) {
|
|
return new Promise((resolve) => {
|
|
http.request(url, (res) => resolve(text(res))).end();
|
|
});
|
|
}
|
|
|
|
await request("http://localhost:4545/echo.ts");
|
|
await request("http://localhost:4545/not-found");
|