forked from Tamreen/web.api
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.js
More file actions
31 lines (22 loc) · 682 Bytes
/
Copy pathserver.js
File metadata and controls
31 lines (22 loc) · 682 Bytes
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
//
require('./main');
// Require the needed services.
require('./services');
// Require the needed routes.
require('./routes');
// Require the needed workers.
require('./workers');
// Attach all previous routes under /api/v2.
app.use('/api/v2', router);
// Start listening to the specified port.
// app.listen(port);
var appName = nconf.get('appName');
var port = nconf.get('appPort');
// Uncomment this before anything.
if (nconf.get('environment') == 'development'){
http.createServer(app).listen(port);
}else{
https.createServer(sslOptions, app).listen(port);
}
//http.createServer(app).listen(port);
console.log('%s is up and running on localhost:%d', appName, port);