In today's tutorial, we are going to build an URL shortner app and deploy it to Heroku. To make the development process easier we'll be using lightweight web framework Express.
* Git installed, and configured on your machine
Git is a version controlling system that tracks each and every change you did you to files in a project. It keeps records on what the changes were did to files (what was added? what was removed), who made the changes, notes and comments about the changes by the changer and also it keeps records on the time which the changes happened.
* Heroku account and Heroku CLI installed, and configured on your machine
If you haven't a Heroku account, you can obtain a account from here. To install install Heroku CLI on your machine follow the steps given here.
Create project directory
Before moving into coding part, you need to create a project directory for our application. Let's cd into the workspace and create a new directory for the project:
Next let's initialize npm, and with it, start our project:
npm init will ask a series of questions like package name, version, description, etc. Node will then generate a package.json file and print it to the terminal or you can simply skip this by running npm init -y. Then we need to add "start": "node app.js" to "scripts" section. This will be extremely important later, when we deploy the app to Heroku.