index.js
649 Bytes
const express = require('express')
const app = express()
const port = 5000
const mongoose = require('mongoose')
mongoose.connect('mongodb+srv://platoon07:wony9795!!@2020oss-ysxss.mongodb.net/test?retryWrites=true&w=majority',{
useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex : true, useFindAndModify: false
}).then(() => console.log('MongoDb connected....'))
.catch(err => console.log('Error'))
app.get('/', (req,res) => res.send('Hello world!!'))
app.listen(port, () => console.log('example app listen on port ${port} !'))
// mongodb+srv://platoon07:<password>@2020oss-ysxss.mongodb.net/test?retryWrites=true&w=majority