Comparing version 0.1.6 to 0.1.7
39
lib.js
@@ -154,27 +154,24 @@ const core = require("./build/Release/ice_node_core"); | ||
core.add_endpoint(this.server, rt.path, call_info => { | ||
// Why setImmediate ? | ||
setImmediate(async () => { | ||
let req = new Request(self, rt, call_info); | ||
for (const mw of mws) { | ||
try { | ||
await mw.handler(req, mw); | ||
} catch (e) { | ||
if (e instanceof Response) { | ||
e.send(self, call_info); | ||
} else { | ||
console.log(e); | ||
new Response({ | ||
status: 500, | ||
body: "Internal error" | ||
}).send(self, call_info); | ||
} | ||
return; | ||
core.add_endpoint(this.server, rt.path, async call_info => { | ||
let req = new Request(self, rt, call_info); | ||
for (const mw of mws) { | ||
try { | ||
await mw.handler(req, mw); | ||
} catch (e) { | ||
if (e instanceof Response) { | ||
e.send(self, call_info); | ||
} else { | ||
console.log(e); | ||
new Response({ | ||
status: 500, | ||
body: "Internal error" | ||
}).send(self, call_info); | ||
} | ||
return; | ||
} | ||
rt.handler(req); | ||
}); | ||
} | ||
rt.handler(req); | ||
}, flags); | ||
} | ||
core.add_endpoint(this.server, "", call_info => setImmediate(() => this.not_found_handler(call_info))); | ||
core.add_endpoint(this.server, "", call_info => this.not_found_handler(call_info)); | ||
@@ -181,0 +178,0 @@ core.listen(this.server, addr); |
{ | ||
"name": "ice-node", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Bindings for the Ice Web Framework", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73605
0
704