2022-02-15 16:17:14 -07:00
|
|
|
'use strict';
|
|
|
|
|
2022-02-23 20:25:05 -07:00
|
|
|
console.log('server process.env.NODE_ENV', process.env.NODE_ENV);
|
|
|
|
|
2022-07-14 10:26:53 -06:00
|
|
|
const assert = require('assert');
|
|
|
|
const config = require('./lib/config');
|
|
|
|
const basePort = config.get('basePort');
|
|
|
|
assert(basePort);
|
|
|
|
const tracing = config.get('tracing');
|
|
|
|
|
|
|
|
if (tracing) {
|
2022-07-14 10:08:50 -06:00
|
|
|
console.log('Tracing is active 🕵️');
|
|
|
|
const { startTracing } = require('./tracing/tracing.js');
|
|
|
|
startTracing();
|
|
|
|
}
|
|
|
|
|
2022-02-15 16:17:14 -07:00
|
|
|
const express = require('express');
|
2022-02-23 20:25:05 -07:00
|
|
|
|
2022-02-15 16:17:14 -07:00
|
|
|
const installRoutes = require('./routes/install-routes');
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
installRoutes(app);
|
2022-02-23 20:25:05 -07:00
|
|
|
|
|
|
|
const server = app.listen(basePort);
|
|
|
|
|
|
|
|
module.exports = server;
|