session-open-group-server-l.../overlay_server.js

22 lines
861 B
JavaScript
Raw Permalink Normal View History

const path = require('path')
2019-12-30 07:16:02 +01:00
if (process.env['config-file-path'] === undefined) {
process.env['config-file-path'] = path.join(__dirname, 'config.json');
}
2020-08-17 07:35:21 +02:00
const loki_middlewares = require('./middlewares.js');
const platform_middlewares = require('./server/middlewares.js');
const apps = require('./server/app.js');
2020-06-25 04:09:23 +02:00
const enableDebug = !!process.env['DEBUG']
2020-08-17 07:35:21 +02:00
if (enableDebug) {
apps.publicApp.use(platform_middlewares.debugMiddleware);
// Express 4.x specific
// position it to spot 2
apps.publicApp._router.stack.splice(2, 0, apps.publicApp._router.stack.splice(apps.publicApp._router.stack.length - 1, 1)[0]);
}
apps.publicApp.use(loki_middlewares.snodeOnionMiddleware);
2020-06-25 04:09:23 +02:00
// Express 4.x specific
// position it to spot 2
apps.publicApp._router.stack.splice(2, 0, apps.publicApp._router.stack.splice(apps.publicApp._router.stack.length - 1, 1)[0]);