forked from fooey/node-gw2guilds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server-start.js
38 lines (29 loc) · 1.25 KB
/
server-start.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
36
37
38
import express from 'express';
import libData from 'lib/data';
import routes from 'routes';
import serverConfig from 'config/server';
const nodeEnv = process.env.NODE_ENV ? process.env.NODE_ENV : 'production';
const serverPort = process.env.PORT ? process.env.PORT : 3000;
libData.init().then(() => {
const app = express();
serverConfig(app, express);
routes(app, express);
app.listen(serverPort, () => {
console.log('');
console.log('**************************************************');
console.log('Express server started');
console.log('Time: %d', Date.now());
console.log('Port: %d', serverPort);
console.log('Mode: %s', nodeEnv);
console.log('PID: %s', process.pid);
console.log('Platform: %s', process.platform);
console.log('Arch: %s', process.arch);
console.log('Node: %s', process.versions.node);
console.log('V8: %s', process.versions.v8);
console.log('cwd: %s', process.cwd());
console.log('dir: %s', __dirname);
// console.log('Env: %s', JSON.stringify(process.env));
console.log('**************************************************');
console.log('');
});
});