1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00
_/ts/main.ts

18 lines
347 B
TypeScript
Raw Permalink Normal View History

2023-06-19 15:20:17 +09:00
import express from "express";
const app = express();
app.get("/", (req, res) => {
res.send("OK");
});
const address = app.listen(3000).address();
console.log(address);
(async () => {
const res = await fetch(`http://127.0.0.1:${address?.port}/`);
console.log(res.url, res.status, res.statusText);
console.log(await res.text());
})();