UNPKG

@excli/express

Version:

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

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