Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.info(`==> 🌎 HTTPS API server listening on port ${ports.api}. Open up https://localhost:${ports.api}/ in your browser.`)
jobs.forEach((job) => job.run())
})
} catch (e) {
logger.error('ssl_key or ssl_cert or intermediate_cert is either missing or invalid. Provide valid SSL configurations.')
}
}
const devMode = config.get('Server:DevMode')
const apiPort = config.get('Server:Port')
const viewerPort = process.env.VIEWER_PORT || config.get('Viewer:Port')
const sslKey = config.get('Server:SslKey')
const sslCert = config.get('Server:SslCert')
const intermedKey = config.get('Server:IntermediateCert')
viewerApp.use('/', ecnViewer.middleware(express))
const isDaemon = process.argv[process.argv.length - 1] === 'daemonize2'
const initState = async () => {
if (!isDaemon) {
// InitDB
try {
await db.initDB()
} catch (err) {
logger.error('Unable to initialize the database.', err)
process.exit(1)
}
// Store PID to let deamon know we are running.
jobs.push({
run: () => {