95
rated 0 times
[
98]
[
3]
/ answers: 1 / hits: 26801
/ 7 Years ago, wed, october 25, 2017, 12:00:00
My function returns a promise that resolves as soon as the HTTP server starts. This is my code:
function start() {
return new Promise((resolve, reject) {
this.server = Http.createServer(app);
this.server.listen(port, () => {
resolve();
});
})
}
How do I convert the start function to async/await?
More From » node.js