Welcome to your new Express app
express 4.21.0 · node v20.11.1If you see this page, the Express server is running and serving the default route. Your project skeleton is ready for development.
// app.js
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello from Express');
});
app.listen(port, () => {
console.log(`listening on http://localhost:${port}`);
});
Next steps
- Edit
routes/index.jsto define your own endpoints. - Add middleware in
app.js— body parsers, logging, sessions. - Pick a view engine: pug, ejs, or hbs in
views/. - Configure environment via
process.env.PORT.
The default GET / handler can be removed once you wire your own routes.