Connection page
First be sure you have Node.js installed.
curl fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y node.js
| CREATING A MongoDB DATABASE CONNECTION WITH MONGOOSE |
Basic setup
Create a GitHub repository using the name of your project and clone it.
Before you do anything run [npm init -y]
Then make a .gitignore to include /node_modules and .env
Then make a .env file which contains the MONGO_URI = [connection URI goes here]
Remember to edit the URI to contain the correct username and password.
Add a different cluster name if necessary.
Next make a src folder
Inside the src folder make a folder named db and create a file called connection.js inside it
Finally inside the parent folder run the following to install the required libraries.
npm i dotenv
npm i mongoose --save
Now we will write the code, click writing the code below
writing the code
server routes