{% extends 'layout.html' %} {% block pageTitle %} How to publish to Heroku - HS2 prototype kit {% endblock %} {% block beforeContent %} {% include "how-tos/includes/breadcrumb.html" %} {% endblock %} {% block content %}
Heroku allows you to get your prototype online quickly. You can then share your prototype with others and test it with users and on different devices.
DO NOT enter real user data into prototypes hosted on Heroku. If your prototype stores or collects user data, talk to a security professional about appropriate security steps you must take.
A prototype deployed on Heroku is called an app.
Before you can use Heroku, you need to set up Git on your prototype.
If you’re new to Heroku, sign up for a free account (opens in new window). When asked what language you use, select node.js
.
Install the Heroku toolbelt (opens in new window).
The toolbelt lets you use Heroku through the terminal. You will need to restart the terminal after installing the toolbelt.
Log into your Heroku account by running:
heroku login
You need a unique name for your app. The name is used in the url for your prototype. For example the name:
hs2-new-service
will create an app at:
hs2-new-service.herokuapp.com
To create your app, enter in the terminal:
heroku apps:create [name of your app] --region eu
Replace [name of your app]
with your app name from step 5.
Prototypes made with the kit require a username and password when published online. This stops members of the public coming across your prototype by accident.
heroku config:set PROTOTYPE_USERNAME=username_here --app [name of your app]
heroku config:set PROTOTYPE_PASSWORD=password_here --app [name of your app]
Make sure any changes you've made to your prototype have been committed to git.
git add .
git commit -m "your commit message here"
Then push your work to Heroku:
git push heroku master
Deploying may take a minute or so.
After your work is deployed, you will be able to view it on the web by visiting [name].herokuapp.com
.
You can also open your prototype in a browser by running:
heroku open
{% include "how-tos/includes/back-button.html" %}