diff --git a/server/server.js b/server/server.js index df75c0f..9762fc5 100644 --- a/server/server.js +++ b/server/server.js @@ -2,7 +2,13 @@ console.log('server process.env.NODE_ENV', process.env.NODE_ENV); -if (process.argv.includes('--tracing')) { +const assert = require('assert'); +const config = require('./lib/config'); +const basePort = config.get('basePort'); +assert(basePort); +const tracing = config.get('tracing'); + +if (tracing) { console.log('Tracing is active 🕵️'); const { startTracing } = require('./tracing/tracing.js'); startTracing(); @@ -11,8 +17,6 @@ if (process.argv.includes('--tracing')) { const express = require('express'); const installRoutes = require('./routes/install-routes'); -const config = require('./lib/config'); -const basePort = config.get('basePort'); const app = express(); installRoutes(app);