express@4.21.2 node v20.11.1 HTTP 200 OK
The HTTP server bound to port 3000 and answered this request through the default index handler. Edit routes/index.js to replace this placeholder with your application logic.
const express = require('express');
const morgan = require('morgan');
const app = express();
app.use(morgan('combined'));
app.use(express.json({ limit: '1mb' }));
app.get('/', (req, res) => {
res.type('text/html').send('Hello from node-runtime-09');
});
app.get('/healthz', (req, res) => res.json({ status: 'ok' }));
app.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).send('internal');
});
app.listen(3000, '0.0.0.0', () => console.log('ready on :3000'));
| Order | Middleware | Path |
|---|---|---|
| 1 | morgan('combined') | /* |
| 2 | express.json | /* |
| 3 | cors() | /api/* |
| 4 | requireAuth | /api/admin/* |
| 5 | errorHandler | /* |
app.use('/api', apiRouter)app.set('trust proxy', 1) if behind a load balancerIf you intended to deploy a different application, verify the working directory of the supervised process and the value of NODE_ENV. Logs are available via pm2 logs or journalctl -u app.service.