Failed Conditions
Push — master ( f5e7b3...711045 )
by Yo
01:30
created

index.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 1
rs 10
1
"use strict";
2
3
if (['dev', 'prod'].indexOf(process.env.NODE_ENV)) {
4
    console.warn(`Undefined node environment "${process.env.NODE_ENV}", fallback to dev !`);
5
    process.env.NODE_ENV = 'dev';
6
}
7
8
const logger = require('./lib/logger');
9
const server = require('./lib/server');
10
const Alfred = require('./lib/Alfred');
11
const pkg = require('./package.json');
12
13
const appName = pkg.name;
14
15
const alfred = new Alfred([]);
16
17
logger.starting(appName);
18
19
server.start(alfred)
20
    .then(() => logger.started(appName))
21
    .catch(error => {
22
        logger.error(`Exit ${appName} after an error => ${error.stack || error}`);
23
24
        process.exit(1);
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
25
    });
26