nodejs/Integration/run-express-server/server.js
2025-01-08 12:57:52 +01:00

20 lines
444 B
JavaScript

const express = require('express');
const app = express();
const PORT = 55555;
// Middleware example: Log request details
app.use((req, res, next) => {
console.log(`${req.method} ${req.url}`);
next();
});
// Example route
app.get('/', (req, res) => {
res.send('Welcome to the Express server on port 55555!');
});
// Start the server
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});