This is a starter project for connecting Node.js applications with MongoDB. It provides a basic template with all the necessary dependencies and configuration files to quickly set up a connection and interact with a MongoDB database.
- MongoDB is a free and open -source cross-platform document database that stores JSON-like documents with schema.
2.This starter kit provides the basic structure for building an application using: - ExpressJS as web framework; - Mongoose ODM (Object Data Modeling) library to work with MongoDB databases, which allows you to create models of your data in JavaScript code without having any knowledge about how Mongo works internally; - Passport authentication middleware package to handle user registration/login
- Clone this repository
git clone https://github.com/AbdurRaahimm/node-mongodb-connect-starter.git- Navigate to the project directory
cd node-mongodb-connect-starter- Run The Essential Dependency
npm install- Create a
.envfile in the project root directory. - Add the following environment variables to the
.envfile:DB_URI: The URI of your MongoDB connection.PORT: (Optional) The port number where the server will run. Default is set to 5000.
- Start the server:
npm start