From e0f1ed5f0c70608bb5e0a98f84864e82e3711800 Mon Sep 17 00:00:00 2001 From: lucaspalomodevelop Date: Thu, 24 Feb 2022 21:29:48 +0100 Subject: [PATCH] add host and port injection in slisten function --- src/index.js | 9 ++------- src/jsste/index.js | 4 +--- src/websrv/index.js | 3 ++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/index.js b/src/index.js index c88d8b2..d7b381c 100644 --- a/src/index.js +++ b/src/index.js @@ -4,11 +4,6 @@ let websrv = require("./websrv")(conf); // console.log("jssteconfig", conf); -websrv.slisten(() => { - console.log( - "Server started on http://" + - conf.webserver.host + - ":" + - conf.webserver.port - ); +websrv.slisten((host, port) => { + console.log("Server started on http://" + host + ":" + port); }); diff --git a/src/jsste/index.js b/src/jsste/index.js index 4b23055..e7fab5a 100644 --- a/src/jsste/index.js +++ b/src/jsste/index.js @@ -1,8 +1,6 @@ app = {}; app.instance = {}; app.static = function (constante, cb, instance = app.instance) {}; -app.specialvars = function (variable_regex, valor, instance = app.instance) {}; +app.specialvars = function (variable_regex, cb, instance = app.instance) {}; app.render = function (pagecode, templatecode) {}; - - diff --git a/src/websrv/index.js b/src/websrv/index.js index 54e9695..d804d89 100644 --- a/src/websrv/index.js +++ b/src/websrv/index.js @@ -21,7 +21,8 @@ module.exports = function (conf) { // }); app.slisten = function (cb) { - app.listen(websrvConfig.port, websrvConfig.host, cb); + + app.listen(websrvConfig.port, websrvConfig.host, () => {cb(websrvConfig.host, websrvConfig.port);}); }; return app;