forked from itteco/iframely
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
27 lines (22 loc) · 901 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
27
var sysUtils = require('./utils');
var app = require('./app');
var server = app.listen(process.env.PORT || CONFIG.port, process.env.HOST || CONFIG.host, function(){
console.log('\niframely is running on ' + server.address().address + ':' + server.address().port);
console.log('API endpoints: /oembed and /iframely; Debugger UI: /debug\n');
});
if (CONFIG.ssl) {
require('https').createServer(CONFIG.ssl, app).listen(CONFIG.ssl.port);
}
console.log('');
console.log(' - support@iframely.com - if you need help');
console.log(' - twitter.com/iframely - news & updates');
console.log(' - github.com/itteco/iframely - star & contribute');
if (!CONFIG.DEBUG) {
var GracefulServer = require('graceful-cluster').GracefulServer;
new GracefulServer({
server: server,
log: sysUtils.log,
shutdownTimeout: CONFIG.SHUTDOWN_TIMEOUT
});
}
module.exports = server;