Skip to content

Instantly share code, notes, and snippets.

@Paden
Created February 15, 2017 02:01
Show Gist options
  • Save Paden/e5146064be4bcbd0259c3db4931a43ab to your computer and use it in GitHub Desktop.
Save Paden/e5146064be4bcbd0259c3db4931a43ab to your computer and use it in GitHub Desktop.
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