|
|
|
@ -21,7 +21,7 @@ const corsOptions = {
|
|
|
|
|
|
|
|
|
|
|
|
// middleware
|
|
|
|
// middleware
|
|
|
|
app.use(express.json()) // use .json(), not .urlencoded()
|
|
|
|
app.use(express.json()) // use .json(), not .urlencoded()
|
|
|
|
app.use(cors(corsOptions))
|
|
|
|
app.use(cors())
|
|
|
|
|
|
|
|
|
|
|
|
// Error / Disconnection
|
|
|
|
// Error / Disconnection
|
|
|
|
mongoose.connection.on('error', err => console.log(err.message + ' is Mongod not running?'))
|
|
|
|
mongoose.connection.on('error', err => console.log(err.message + ' is Mongod not running?'))
|
|
|
|
|