mirror of
https://github.com/lucaspalomodevelop/JSSTE_APP.git
synced 2026-03-13 08:09:38 +00:00
add SIGINT
This commit is contained in:
parent
8632c73d1d
commit
fafd02352c
@ -1,7 +1,12 @@
|
||||
let conf = require("./helper/conf")();
|
||||
let websrv = require("./websrv")(conf);
|
||||
|
||||
|
||||
websrv.slisten((host, port) => {
|
||||
console.log("Server started on http://" + host + ":" + port);
|
||||
});
|
||||
|
||||
process.on("SIGINT", () => {
|
||||
console.log("\nWeb-Server Beenden ...");
|
||||
websrv.close();
|
||||
process.exit();
|
||||
});
|
||||
|
||||
@ -14,8 +14,17 @@ module.exports = function (conf) {
|
||||
app.use("/internal", internalRouter);
|
||||
|
||||
app.slisten = function (cb) {
|
||||
app.ServerInstance = app.listen(
|
||||
websrvConfig.port,
|
||||
websrvConfig.host,
|
||||
() => {
|
||||
cb(websrvConfig.host, websrvConfig.port);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
app.listen(websrvConfig.port, websrvConfig.host, () => {cb(websrvConfig.host, websrvConfig.port);});
|
||||
app.close = function () {
|
||||
app.ServerInstance.close();
|
||||
};
|
||||
|
||||
return app;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user