I'm trying to create a mongo DB database with node js. I have installed MongoDB community server 4.4 in my computer. I can do CRUD operations directly from the console. But when I try to connect it to my app It does not work. There is no error message in the console. My code as follows.
const express = require('express')
const bodyParser = require('body-parser')
const ejs = require('ejs')
const mongoose = require('mongoose')
const app = express()
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(express.static("public"));
mongoose.connect("mongodb://localhost:27017/wikiDB", {useNewUrlParser: true, useUnifiedTopology: true})
app.listen(3000, function(){
console.log("Server started on port 3000");
});