-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (20 loc) · 719 Bytes
/
app.js
File metadata and controls
26 lines (20 loc) · 719 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
#!/usr/bin/env node
"use strict";
var newrelic = require('newrelic')
, morgan = require('morgan')
, express = require('express')
, argv = require('minimist')(process.argv.slice(2))
, logStream = require('./lib/logStream')
, server = require('./lib/server')
, Starling = require('./lib/starling')
, app = express();
var port = process.env.PORT || argv.port
, stream = logStream(process.env.LOG || argv.log)
, starling = new Starling(argv._);
app.use(morgan({ format: 'tiny', stream: stream }));
server(app, starling);
app.enable('trust proxy');
app.listen(port, function () {
console.log('Server listening on port %d\nStarling port(s): %s', port, argv._);
});
exports = module.exports = app;