express framework
Install Express:
bash npm install express
Create an Express application:
javascript const express = require('express'); const app = express();
Define a route with a callback function:
javascript app.get('/', (req, res) => { res.send('Hello, World!'); });
Start the Express server:
javascript const port = 3000; app.listen(port, () => { console.log(`Server is listening on port ${port}`); });
Run the application:
bash node your_app_filename.js
Access the application in a web browser or a tool like curl:
http://localhost:3000