Fix: Application should accept incoming requests after all the files are bootstrapped

This commit is contained in:
ibakshay 2019-12-02 10:11:26 +01:00
Родитель d96ee17570
Коммит 1040d232a0
2 изменённых файлов: 23 добавлений и 4 удалений

15
app.js
Просмотреть файл

@ -1,9 +1,16 @@
let http = require('http');
//////////////////////////////////////////////////////////////////////////////////////////////
// Initialize server
//////////////////////////////////////////////////////////////////////////////////////////////
let app = require('./src/server/app.js');
let app = require('./src/server/app.js')
// let http = require('http')
http.createServer(app).listen(config.server.localport);
// // eslint-disable-next-line no-console
// console.log("App is initialized")
// let server = http.createServer(app)
// // eslint-disable-next-line no-console
// console.log("Server is created")
// const listener = server.listen(config.server.localport, function () {
// // eslint-disable-next-line no-console
// console.log('Listening on port ' + listener.address().port)
// });

Просмотреть файл

@ -1,3 +1,6 @@
let http = require('http')
/* eslint no-console: "off"*/
require('colors')
const async = require('async')
@ -196,6 +199,15 @@ async.series([
console.log(`${'\n✓ '.bold.green}bootstrapped for ${app.get('env')}, app listening on ${config.server.http.host}:${config.server.localport}`.bold)
log.info(`✓ bootstrapped for ${app.get('env')}!!! App listening on ${config.server.http.host}:${config.server.http.port}`)
// eslint-disable-next-line no-console
console.log("App is initialized")
let server = http.createServer(app)
// eslint-disable-next-line no-console
console.log("Server is created")
const listener = server.listen(config.server.localport, function () {
// eslint-disable-next-line no-console
console.log('Listening on port ' + listener.address().port)
});
});
// ////////////////////////////////////////////////////////////////////////////////////////////////