Page Index - ManishKakarla/Exercise-N1 GitHub Wiki
26 page(s) in this GitHub Wiki:
- Home
- Heroku-Express
- Database-Console
- 1. Heroku-Express
- Step 1: Create a project with express and nodejs
- Step 2: Install all the required dependencies using npm i express mongodb mongoose ejs
- Step 3: Create database for this app using mongodb atlas and also create collection and insert data into the collection and Retrieve data created from the database and it can be verified by using the localhost/db url.
- Step 4: Do "npm start". This will run the server locally.
- Step 5: Push your code to the github repository and make it public
- Step 6: Creating heroku app in the ide terminal with the following commands
- a) heroku login
- b) heroku create (This will create the heroku app .)
- c) git push heroku master (To deploy your app to Heroku, you typically use the git push command to push the code from your local repository’s master or main branch to your heroku remote.)
- d) heroku ps:scale web=1
- Step 3: Now you can view the "infinite-brook-61397" app running successfully using the URL link
- Step 4: Screenshot of "infinite-brook-61397.herokuapp.com/" running successfully on heroku cloud running on free dynos and web npm start being the main page.
- 2.Database Console
- 1. Sign in to your mongoDb Atlas account using the url
- 2. Click on create a new cluster, then a new cluster would get created for the project
- 3. Below is the cluster created .Now click on Connect.
- 4. After clicking on connect, the below window appears. Click on connect your application.
- 5. Choose a connection method:
- 6. I am using Mongo compass here to connect to the cluster and create a database. You can do it in MongoDB Atlas as well.
- 7. Add data to the db by using insert document tab
- Database console
- Heroku Express