beginning refactor for production server hosting
This commit is contained in:
parent
075bb2579c
commit
2ff0b7fa9f
@ -16,25 +16,25 @@ import ClientBase from './clients/clientBase';
|
||||
import MHSClient from './clients/sites/mhsClient';
|
||||
|
||||
|
||||
if (app.environment == 'development') {
|
||||
var privateKey = fs.readFileSync(app.privateKey, 'utf8');
|
||||
var certificate = fs.readFileSync(app.certificate, 'utf8');
|
||||
var options = {key: privateKey, cert: certificate, hostname: app.hostname};
|
||||
// if (app.environment == 'development') {
|
||||
// var privateKey = fs.readFileSync(app.privateKey, 'utf8');
|
||||
// var certificate = fs.readFileSync(app.certificate, 'utf8');
|
||||
// var options = {key: privateKey, cert: certificate, hostname: app.hostname};
|
||||
|
||||
const application = express();
|
||||
const server = https.createServer(options, application);
|
||||
var wss = new WebSocket.Server({ server: server, maxPayload:250000, host: app.hostname });
|
||||
// const application = express();
|
||||
// const server = https.createServer(options, application);
|
||||
// var wss = new WebSocket.Server({ server: server, maxPayload:250000, host: app.hostname });
|
||||
|
||||
application.use(express.json());
|
||||
application.use('', routes);
|
||||
// application.use(express.json());
|
||||
// application.use('', routes);
|
||||
|
||||
server.listen(app.port, () => {
|
||||
console.log(`Braid v${app.version} is running!\n`);
|
||||
logger.accessLog.info(`Braid v${app.version} is running!\n`);
|
||||
});
|
||||
} else {
|
||||
var wss = new WebSocket.Server({ noServer: true, maxPayload:250000, host: app.hostname });
|
||||
}
|
||||
// server.listen(app.port, () => {
|
||||
// console.log(`Braid v${app.version} is running!\n`);
|
||||
// logger.accessLog.info(`Braid v${app.version} is running!\n`);
|
||||
// });
|
||||
// } else {
|
||||
var wss = new WebSocket.Server({ maxPayload:250000, port: app.port });
|
||||
// }
|
||||
|
||||
let clientManager = new ClientManager();
|
||||
let channelManager = new ChannelManager();
|
||||
|
Loading…
x
Reference in New Issue
Block a user