Deploying with Heroku - Production and App Launch

Logging into Heroku

Before we can start working on our apps on Heroku, we need to log into the Heroku system using the Heroku CLI tool. To do that, simply open a command window and enter the command heroku login. This will start a process that prompts us for our email and password (email may already be provided as a default). The exchange should look like this:

root@educative:/onboarding-api$ heroku login -i
heroku: Enter your login credentials
Email [mamund@example.com]:
Password: *********
Logged in as mamund@example.com

root@educative:/onboarding-api$

Once the CLI says you’re Logged in as ..., we’re ready to start using the command-line tool to remotely manage our server space on the Heroku servers.

Creating a new Heroku app

To be able to deploy to the Heroku platform, we first need to create a target or app space. This will be the place our deployment goes and, if successful, will be the address of the running instance of our API project. Creating a Heroku application is easy; we just type the command heroku create, and the CLI does the rest.

root@educative:/onboarding-api$ heroku create
Creating app... done, lit-waters-82098
https://lit-waters-82098.herokuapp.com/ | https://git.heroku.com/
lit-waters-82098.git

root@educative:/onboarding-api$

What we see here is that Heroku created an app space on its server and named it lit-waters-82098. That’s the unique name of our Heroku app space.

Heroku also displays two URLs. The first one is the public URL for our running API project. If we visit that link right now, we’ll see a default “Welcome” page displayed, as shown in the following screenshot:

Get hands-on with 1400+ tech skills courses.