Deployment via Heroku - liferesearchapp/life-research-members-portal GitHub Wiki
Heroku is a cloud application platform that allows for hosting web applications and automatic redeployment from Github on push.
It is very easy to use and most steps are self explanatory.
After logging in, select New -> create new app. Then input the name and region of the app.
Under Deploy, you may choose to connect this app to a Github repo and enable automatic deploys.
Under Settings -> Buildpacks select Add buildpack -> Node.js this will run npm install
, npm build
, and npm start
to deploy the application.
We need to set the secret database connection string as an environment variable to allow our backend to connect to the database.
Under Settings -> Reveal Config Vars set "DATABASE_URL" as a key, and the database connection string as a value.
In the Azure Portal you can find the connection string under the SQL database -> connection strings -> JDBC -> JDBC (SQL authentication). Just remove the "jdbc:" prefix and insert the database password.
The string should look something like this: DATABASE_URL="sqlserver://life-server.database.windows.net:1433;database=life-database;user=chami033@life-server;password={your_password_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"
If you have enabled automatic deploys, simply push a commit to the connected Github branch to deploy the app.
Otherwise, you may use the Heroku CLI, or deploy manually under Deploy -> Manual Deploy -> Deploy Branch.
The domain of the app is found under Settings -> Domains and is https://<app-name>.herokuapp.com/
by default.
Build history and logs can be found under Activity.