// required libs : mongoose | colors
      // run the following command
      // npm i mongoose colors
      
      const colors = require('colors');
      const mongoose = require('mongoose')
      mongoose.connect(process.env.URI , { useNewUrlParser : true, useUnifiedTopology : true})
      .then((res)=>console.log('> Connected...'.bgCyan))
      .catch(err=>console.log(`> Error while connecting to mongoDB : ${err.message}`.underline.red ))
      Javascript language logo
      your recipe card header background

      connect to to mongoDB

      MERN cookbook

      Library: express

      Shortcut: app.connect

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.