Heroku Deploy
When it comes to deploying an application, there are usually two options: a VPS or a PaaS (platform as a service). here i will show you a recipe for deploying an application to production on a PaaS like Heroku.
Step 1 - Create the project
The first step is to create a simple structure for our project with some basic files. For this article, I’ll create a demo server with NodeJS.
In a new folder I’ll open a terminal and run the command npm init -y in order to create a new project. The dummy server will be written in Express, so we need to run the npm install express command to install this module.
Once this library is installed, we can create a new file for our project, named app.js. Inside it we’ll write the code for our simple server:
We can start the application by running node app.js. Then we can try it out at the following URL http://localhost:3000. At this point you should see the message Hello World in the browser.
Great apps come from developers using tools and languages they love. That’s why a great developer experience has always been at the very heart of what we do. We embrace the languages of the modern app economy: Node, Ruby, Java, Scala, PHP and more. Heroku makes the processes of deploying, configuring, scaling, tuning, and managing apps as simple and straightforward as possible, so that developers can focus on what’s most important: building great apps that delight and engage customers.
Data lies at the heart of any significant app — whether it’s customer data or data about the service it provides — an app and its data go hand in hand. Heroku’s rich ecosystem of managed data services includes Heroku Postgres, Heroku Redis and Apache Kafka on Heroku. Developers shouldn’t need to discover how to optimally provision a database through trial and error - but instead have immediate access to a scalable, highly available database with rollback - one that supports their apps and development style.
Conclusion
Heroku allows developers to quickly and almost painlessly deploy an application on a web server.
It also provides a lot of plugins that you can integrate into your application.
A PaaS solution will always allow you to move faster than the solution with a VPS where you have to configure everything from the ground up.