index or server.js
Sat Aug 28 2021 18:52:53 GMT+0000 (Coordinated Universal Time)
Saved by
@13tinydots
#javascript
// this is sometimes named "server.js" as well
import express from "express";
import config from "./config.js";
import apiRouter from "./routes.js";
const app = express();
app.get("/", (_, res) => {
res.send("Hello World!");
});
app.use("/api", apiRouter);
app.listen(config.port, () => {
console.log(`Listening on port ${config.port}`);
});
content_copyCOPY
Comments