add host and port injection in slisten function

This commit is contained in:
lucaspalomodevelop 2022-02-24 21:29:48 +01:00
parent 1b9688ea57
commit e0f1ed5f0c
3 changed files with 5 additions and 11 deletions

View File

@ -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);
});

View File

@ -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) {};

View File

@ -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;