-
Notifications
You must be signed in to change notification settings - Fork 303
/
server.js
27 lines (22 loc) · 885 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
import * as sysUtils from './utils.js';
import app from './app.js';
import * as https from 'https';
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) {
https.createServer(CONFIG.ssl, app).listen(CONFIG.ssl.port);
}
console.log('');
console.log(' - [email protected] - if you need help');
console.log(' - twitter.com/iframely - news & updates');
console.log(' - github.com/itteco/iframely - star & contribute');
import { GracefulServer } from 'graceful-cluster';
if (!CONFIG.DEBUG) {
new GracefulServer({
server: server,
log: sysUtils.log,
shutdownTimeout: CONFIG.SHUTDOWN_TIMEOUT
});
}