Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
return new Promise((resolve, reject) => {
mongoose.connect(DATABASE_URL, err => {
if (err) {
return reject(err);
}
server = app.listen(port, () => {
console.log(`Your app is listening on port $ {port}`);
resolve(server);
}).on('error', err => {
reject(err);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment