Commit 3512ff81 authored by Eduardo L. Buratti's avatar Eduardo L. Buratti
Browse files

Fix server exiting after initialization

parent 42d1905e
...@@ -38,17 +38,11 @@ ramlParser.loadFile("specs/blendb-api-v1.raml") ...@@ -38,17 +38,11 @@ ramlParser.loadFile("specs/blendb-api-v1.raml")
osprey.server(raml), osprey.server(raml),
router); router);
if (!module.parent) { let port = process.env.PORT || 3000;
let port = process.env.PORT || 3000; app.listen(port);
app.listen(port);
if (app.get("env") === "development") { if (app.get("env") === "development") {
console.log("Server listening on port " + port + "."); console.log("Server listening on port " + port + ".");
}
}
else {
// signalize to the test suite that the server is ready to be tested
app.locals.ready = true;
} }
}, },
(err: any) => { (err: any) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment