20 lines
444 B
JavaScript
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}`);
|
|
});
|