Thrown error in promisified ExpressJs function Thrown error in promisified ExpressJs function express express

Thrown error in promisified ExpressJs function


This has nothing to do with promises, it's just basic javascript: you are calling listen as if it was a function but it's a method of app.

Some options:

Promise.promisifyAll(app);// Note how it's called as a method on appapp.listenAsync(...).then(....)

Or

// Bind the function as a method of appvar appListenAsync = Promise.promisify(app.listen, app);appListenAsync(...).then(....)