diff --git a/services/auth/server/server.js b/services/auth/server/server.js index 71e359136..c87c400dc 100644 --- a/services/auth/server/server.js +++ b/services/auth/server/server.js @@ -4,3 +4,6 @@ var vnLoopback = require('../../loopback/server/server.js'); var app = module.exports = vnLoopback.loopback(); app.set('applications', require('./application.json')); vnLoopback.boot(app, __dirname); +if (require.main === module) { + app.start(); +} diff --git a/services/client/server/server.js b/services/client/server/server.js index 1f10f7f51..eda31589d 100644 --- a/services/client/server/server.js +++ b/services/client/server/server.js @@ -3,3 +3,6 @@ var vnLoopback = require('../../loopback/server/server.js'); var app = module.exports = vnLoopback.loopback(); vnLoopback.boot(app, __dirname); +if (require.main === module) { + app.start(); +} diff --git a/services/loopback/server/server.js b/services/loopback/server/server.js index 55ff51e36..431ca8775 100644 --- a/services/loopback/server/server.js +++ b/services/loopback/server/server.js @@ -84,11 +84,10 @@ function vnBoot(app, rootDir, cb) { boot(app, bootOptions, function(err) { if (err) throw err; + if (require.main === module) { + app.start(); + } if (cb) cb(app); }); - - if (require.main === module) { - app.start(); - } } diff --git a/services/production/server/server.js b/services/production/server/server.js index f59b8971e..bc4b454c4 100644 --- a/services/production/server/server.js +++ b/services/production/server/server.js @@ -2,3 +2,6 @@ var vnLoopback = require('../../loopback/server/server.js'); var app = module.exports = vnLoopback.loopback(); vnLoopback.boot(app, __dirname); +if (require.main === module) { + app.start(); +} diff --git a/services/route/server/server.js b/services/route/server/server.js index 1f10f7f51..eda31589d 100644 --- a/services/route/server/server.js +++ b/services/route/server/server.js @@ -3,3 +3,6 @@ var vnLoopback = require('../../loopback/server/server.js'); var app = module.exports = vnLoopback.loopback(); vnLoopback.boot(app, __dirname); +if (require.main === module) { + app.start(); +} diff --git a/services/salix/server/server.js b/services/salix/server/server.js index e67d6aa42..4c7743f0d 100644 --- a/services/salix/server/server.js +++ b/services/salix/server/server.js @@ -11,3 +11,7 @@ app.set('url auth', '/auth'); app.use(cookieParser()); vnLoopback.boot(app, __dirname); + +if (require.main === module) { + app.start(); +}