UNPKG

@excli/express

Version:

A cli tool for creating Express.js applications, supporting both JavaScript and TypeScript.

15 lines (11 loc) 366 B
import { createServer } from "node:http"; import app from "./app.js"; import { configs } from "./constant.js"; app.get("/", (_, res) => { res.status(200).send("<h1>Hello World</h1>"); }); (async () => { const PORT = configs.PORT || 3000; const server = createServer(app); server.listen(PORT, () => console.log(`Express: http://localhost:${PORT}`)); })();