Heroku Express - ManishKakarla/Exercise-N1 GitHub Wiki

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

https://infinite-brook-61397.herokuapp.com/db

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.