Node.js: fixing Server.listen() method.
This is required for Express framework compatibility. This closes #418 issue on GitHub.
This commit is contained in:
@@ -451,8 +451,18 @@ Server.prototype.setTimeout = function setTimeout(msecs, callback) {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Server.prototype.listen = function () {
|
Server.prototype.listen = function (...args) {
|
||||||
this.unit.listen();
|
this.unit.listen();
|
||||||
|
|
||||||
|
const cb = args.pop();
|
||||||
|
|
||||||
|
if (typeof cb === 'function') {
|
||||||
|
this.once('listening', cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit('listening');
|
||||||
|
|
||||||
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Server.prototype.emit_request = function (req, res) {
|
Server.prototype.emit_request = function (req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user