Web Server Integration

This commit is contained in:
Luis Fernando Molina committed 2020-04-16 10:55:15 +02:00
1 parent 77b01ccb86
commit 95ae16595c
256 files changed
+3522 -8

No files matched your search

+23 -1
View File
@@ -1,7 +1,7 @@
process.on('uncaughtException', function (err) {
if (err.message.indexOf("EADDRINUSE") > 0) {
console.log("Superalgos Backend Server cannot be started. Reason: the port " + port + " is already in use by another application.")
console.log("A Superalgos Backend Server cannot be started. Reason: the port " + port + " is already in use by another application.")
return
}
console.log('[ERROR] Backend Server -> server -> uncaughtException -> err.message = ' + err.message)
@@ -27,9 +27,26 @@ global.DEFAULT_FAIL_RESPONSE = {
message: "Operation Failed"
};
global.DEFAULT_RETRY_RESPONSE = {
result: 'Retry',
message: 'Retry Later'
}
global.CUSTOM_OK_RESPONSE = {
result: 'Ok, but check Message',
message: 'Custom Message'
}
global.CUSTOM_FAIL_RESPONSE = {
result: 'Fail Because',
message: 'Custom Message'
}
let EVENTS_SERVER = require('./eventsServer.js');
let WEB_SOCKETS_SERVER = require('./webSocketsServer.js');
let TASK_MANAGER_SERVER = require('./taskManagerServer.js');
let WEB_SERVER = require('./webServer.js');
try {
EVENTS_SERVER = EVENTS_SERVER.newEventsServer()
@@ -43,6 +60,11 @@ try {
TASK_MANAGER_SERVER = TASK_MANAGER_SERVER.newTaskManagerServer(WEB_SOCKETS_SERVER, EVENTS_SERVER)
TASK_MANAGER_SERVER.initialize()
TASK_MANAGER_SERVER.run()
WEB_SERVER = WEB_SERVER.newWebServer(EVENTS_SERVER)
WEB_SERVER.initialize()
WEB_SERVER.run()
} catch (err) {
console.log('[ERROR] BackendServers -> Task Manager -> server -> Error = ' + err.stack)
}