Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/proxy_server/node_modules/express-status-monitor/examples/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /* eslint no-console: "off" */
const socketIoPort = 2222;
const express = require('express');
// This is optional. If your server uses socket.io already, pass it to config as `webserver` along with it's port.
const socketio = require('socket.io')(socketIoPort);
const app = express();
const port = process.env.PORT || 3000;
app.use(
require('../index')({
path: '/',
// Use existing socket.io instance.
// websocket: socketio,
// Ignore requests which req.path begins with
// ignoreStartsWith: '/return-status',
// Pass socket.io instance port down to config.
// Use only if you're passing your own instance.
// port: socketIoPort,
healthChecks: [
{
protocol: 'http',
host: 'localhost',
port: 3000,
path: '/admin/health/ex1',
headers: {},
},
{
protocol: 'http',
host: 'localhost',
port: 3000,
path: '/return-status/200',
headers: {},
},
],
}),
);
app.use(require('express-favicon-short-circuit'));
// Example route throwing requested status code
app.get('/return-status/:statusCode', (req, res) =>
res.sendStatus(req.params.statusCode),
);
app.listen(port, () => {
console.log(`Listening on http://0.0.0.0:${port}`);
});
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]-- |