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