1 |
|
2 | const socketIoPort = 2222;
|
3 |
|
4 | const express = require('express');
|
5 |
|
6 |
|
7 | const socketio = require('socket.io')(socketIoPort);
|
8 |
|
9 | const app = express();
|
10 | const port = process.env.PORT || 3000;
|
11 |
|
12 | app.use(
|
13 | require('../index')({
|
14 | path: '/',
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | healthChecks: [
|
25 | {
|
26 | protocol: 'http',
|
27 | host: 'localhost',
|
28 | port: 3000,
|
29 | path: '/admin/health/ex1',
|
30 | headers: {},
|
31 | },
|
32 | {
|
33 | protocol: 'http',
|
34 | host: 'localhost',
|
35 | port: 3000,
|
36 | path: '/return-status/200',
|
37 | headers: {},
|
38 | },
|
39 | ],
|
40 | }),
|
41 | );
|
42 | app.use(require('express-favicon-short-circuit'));
|
43 |
|
44 |
|
45 | app.get('/return-status/:statusCode', (req, res) =>
|
46 | res.sendStatus(req.params.statusCode),
|
47 | );
|
48 |
|
49 | app.listen(port, () => {
|
50 | console.log(`Listening on http://0.0.0.0:${port}`);
|
51 | });
|