Open Source Tooling and Automation Part 3: Deploy to Heroku

Welcome everyone!

Today I am going to use Heroku. Heroku is a clod hosting platform.

Create a node.js Web Server

I am going to create a simple REST API for Seneca module using Express web framework for node.js.

First, I am going to install Express using npm:

Screenshot from 2017-04-06 15-21-37

After creating server.js file and running it with the following command:

node server.js

I got the following:

Screenshot from 2017-04-06 17-11-52

8

Now, after we tested our server.js and made sure that it works, we can move on to the next part.

Deploy to Heroku

Step 1 – Create your account

In order to create an account we should go here.

9

Step 2 – Download the Heroku CLI

After installing Heroku, you can login with your credentials:

11

Step 3 – Create Heroku App Settings Files

Next step is to create a Procfile which is going to look like this:

12

Step 4 – Deploy the App

First, I am going to create a new app using Heroku CLI:

13

After this, we need to make sure we added all of the files and committed them. Now we can push our code to Heroku.

Screenshot from 2017-04-06 19-08-47.png

Screenshot from 2017-04-06 19-08-56

By doing all the above we just deployed the our code to Heroku. Now we need to start the app.

heroku ps:scale web=1

heroku open

14

 

I found this lab really interesting and knowledgeable. Like all labs that I have completed in OSD600. I deployed an app!!! I learned how to create a node.js web server and what is Heroku and how to use it.

 

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