generated from KTH/node-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·35 lines (29 loc) · 907 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict'
require('dotenv').config()
const { KthAppinsights } = require('@kth/appinsights')
KthAppinsights.init({ name: 'kurs-pm-web' })
const log = require('@kth/log')
const config = require('./server/configuration').server
const server = require('./server/server')
const packageFile = require('./package.json')
// catches uncaught exceptions
process.on('uncaughtException', err => {
log.error('APPLICATION EXIT - uncaught exception in ', packageFile.name)
log.error('Uncaught Exception', { err })
process.exit(1)
})
/* ****************************
* ******* SERVER START *******
* ****************************
*/
// Exports a promise to use in integration tests
module.exports = server.start({
useSsl: config.useSsl,
pfx: config.ssl.pfx,
passphrase: config.ssl.passphrase,
key: config.ssl.key,
ca: config.ssl.ca,
cert: config.ssl.cert,
port: config.port,
logger: log,
})