Last active
September 21, 2020 03:16
-
-
Save jinwook-k/f75106662bba25d35e6bdcffba7edc8e to your computer and use it in GitHub Desktop.
server/server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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