Skip to content

Instantly share code, notes, and snippets.

@jinwook-k
Last active September 21, 2020 03:16
Show Gist options
  • Save jinwook-k/f75106662bba25d35e6bdcffba7edc8e to your computer and use it in GitHub Desktop.
Save jinwook-k/f75106662bba25d35e6bdcffba7edc8e to your computer and use it in GitHub Desktop.
server/server.js
const mongoose = require('mongoose');
// use body parser to get data from POST requests
...
// Use API routes from the api folder
...
// Connect to Mongo
mongoose.connect(process.env.DB, {
useNewUrlParser: true,
useUnifiedTopology: true
}).then(() => console.log('MongoDB Connected...')).catch(err => console.log(err));
app.listen(...);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment