-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
26 lines (20 loc) · 973 Bytes
/
server.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
'use strict';
var express = require ( 'express' ) ,
morgan = require ( 'morgan' ) ,
cors = require ( 'cors' ) ,
router = require ( './router/router' ) ,
logger = require ( './utilities/logger' ) ,
environment = require ( './environment' ) ,
application = express () ,
server ;
// Setup the router
application.use (morgan('combined'));
application.use ( cors () );
application.use ( '/' , router );
// Start the application
server = application.listen ( environment.port , function () {
// Log a friendly message on the current environment details
logger.log ( 'ENVIRONMENT : ' , environment.name );
logger.log ( 'PORT : ' , environment.port );
logger.log ( 'ADDRESS : ' , server.address ().address );
});