Article Image
Article Image
read
What is Heroku?
Some of you may be wondering exactly what Heroku is. Basically Heroku is a cloud platform as a service. This allows developers build, deliver, monitor, and scale apps. Heroku is often regarded as the fastest way to go from idea to URL, whereby you do not have to worry about infrastructure; you just focus on your application.
Advantages/Benefits
There is no doubt that Heroku takes away all the pain of installing software, configuring servers, maintaining it, and monitoring the software — it takes care of most of the configurations for you. Other services could easily be added as add-ons.
Heroku Features:
- Instant Deployment with Git push - build of your application is performed by Heroku using your build scripts
- Plenty of Add-on resources (applications, databases etc.)
- Security
- Processes scaling — independent scaling for each component of your app without affecting functionality and performance
- Isolation — each process (aka dyno) is completely isolated from each other thorough Documentation
- Full Logging and Visibility - easy access to all logging output from every component of your app and each process (dyno)
Deploying your app in 7 steps
Here are some prerequisites you need to deploy your app:
- Node.js and npm installed.
- A Node.js app.
- A free Heroku account.
- The Heroku CLI.
Let’s get down to it!
- Login to your Heroku via the command line
heroku login
. This will prompt for your credential. - Add Procfile to your application root directory
touch Procfile
. Note: A Procfile is not necessary to deploy apps written in most languages supported by Heroku. The platform automatically detects the language, and creates a default web process type to boot the application server. In the case of Node.js, it will start a default web process via the start script in your package.json. Creating an explicit Procfile is recommended for greater control and flexibility for your app. - Open your favorite text editor and place the following line inside your
Procfile
web: node index.js
. - Create Heroku remote repository
heroku create appName
. - Add the new changes made to the app
git add
. - Commit the snapshot
git commit -m “Added a Procfile.”
. -
Push to your app to the newly created heroku remote repository
git push heroku master
.That’s all there is to it! I hope this post has helped you!!