how to host rest api on heroku server using command line?

A warm welcome to All  Readers,

This Blog is about “how you can host your rest api created using mysql and node.js

Heroku is a platform which will allow us to host maximum 5 applications without any charges  and it is very simple to deploy and scale our node.js application to heroku server..In this demo,i am using command line to deploy the application on heroku server.

follow the steps as shown below.

1)download and install heroku toolbelt from https://devcenter.heroku.com/articles/heroku-command-line/

2)initialize the project as a git directory using following command

git initgit init.png

3)Login using your Heroku account

heroku login

herokulogin.png

4)create heroku application on server using following command

heroku create name of the application

herokucreateapp.png

5)Dont’t forget to add .gitignore file to your directory.

gitignore

5)push your application to heroku  server by following just 3 steps from your command line.

1)git add .

git add.png

2)git commit -m “initial commit”

gitcommit.png

3)git push heroku master

Screenshot (40).pngScreenshot (41).pngherokupush.pngonserveronserver1.png

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s