1 2 3 4 5 6 7 8 9 10 11 12
import express from "express"; const app = express(); const PORT = process.env.PORT || 3000; app.get("/", (req, res) => { res.send("Welcome to the API!"); }); app.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); });