Deployment - pmvdbijl7/matching-app GitHub Wiki
Deploying your application to a service like Heroku is for one really cool because you can show what you made to anyone. It is also useful for testing the application. It allows you to access the latest version of your app on any device without installing anything.
I chose Heroku for this project because I have worked with it before. It's relatively simple to deploy something to this platform. Heroku has really clear documentation on their website. If the documentation leaves you puzzeled there are a ton of video's showing you exactly how to deploy your application.
In order to get your application on Heroku's server you'll have to install a few things. NB: this guide is for macOS if you're a windows user use this link instead
- Step one is to create a Heroku account
- You'll need homebrew to install through the CLI
- Next you can use homebrew to install heroku using the following command:
$ brew install heroku/brew/heroku
-
Now we will switch to the Heroku GUI on heroku.com, navigate to the dashboard an click new
-
Fill in the name and choose your region and click create app
-
Go to your project in the terminal and execute the following commands:
$ git add .
$ git commit -am "make it better"
$ git push heroku main
-
The app is now on Heroku! It probably isn't working though, if you have a .env file you'll have to add these variables to Heroku
-
Navigate to the settings
-
Click reaveal config vars
-
Fill in your vars, important: create a new var for each var!
-
The last step is telling heroku what to do when trying to launch your app, this can be done by creating a procifle
-
In the root of your project create a file called Procfile
-
In this file declare the following:
web: node <appname.js>
- Now your app should work!