Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

connect mongoose to application js

// Connect to the Database here
mongoose.connect("mongodb://localhost:27017/test", {
  useNewUrlParser: true,
  useUnifiedTopology: true,
}, (err) => {
    if (err) return console.log(err);
    app.listen(3000, () => {
        console.log("MongoDB Server listening on 3000");
    });
});
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #connect #mongoose #application #js
ADD COMMENT
Topic
Name
8+6 =