UNPKG

659 BJavaScriptView Raw
1process.env.BLAZE_ROOT = __dirname;
2
3const {
4 SetupServer,
5 Log,
6 GenerateError,
7 HandleSSL
8} = require('./lib/');
9
10const config = require('./config/config.json');
11
12const http = require('http');
13const https = require('https');
14
15module.exports.http = SetupServer(http.createServer(), 'http');
16config.http.ports.forEach(port => {
17 console.log('listening on ' + port)
18 module.exports.http.listen(port);
19});
20
21module.exports.https = SetupServer(https.createServer({ SNICallback: HandleSSL }), 'https');
22config.https.ports.forEach(port => {
23 console.log('listening on ' + port)
24 module.exports.https.listen(port);
25});
\No newline at end of file