You will need two pieces of information at a minimum to get this running correctly.
APIKEY
- API Key from Pelion Device Management - https://portal.mbedcloud.com/APP_HOST
- URL of the application to be deployed -https://<APP>.herokuapp.com/
Create an app in Heroku by cloning from an existing Git repository
- Goto Github app: Workshop App on Github
- Click Deploy to Heroku button
- Create a free Heroku account
- Provide First name, Last name, Email address, Role, Country, Development language
- Confirm your email and set a password
- Welcome -> Click here to proceed
- Continues create app flow
- Enter name for your app:
APP
Build process starts and app will deploy to https://<APP>.herokuapp.com/
Heroku apps provide configuration options through environment variables. These are called config vars. Two are required for this app to be setup correctly. There are three more that are optional.
- Start at
https://dashboard.heroku.com/apps/<APP>
Manage App
-->Settings
-->Reveal Config Vars
Key | Value | Optional | Default |
---|---|---|---|
API_KEY | APIKEY |
||
APP_HOST | https://APP .herokuapp.com/ |
||
API_HOST | APIHOST |
✓ | https://api.us-east-1.mbedcloud.com |
LONG_POLLING_ENABLED | true or false |
✓ | false |
DEVICE_ID | Comma separated list of device IDs | ✓ | * |
RESOURCE | Comma separated list of resource paths | ✓ | /3303/* |
This app requires access to a Postgres database to store resource values. Heroku provides a free-tier access to hosted Postgres without requiring billing information
- Start at
https://dashboard.heroku.com/apps/<APP>
- Navigate to
Resources
->Add-ons
- Search for
postgres
and attach a free "Hobby Dev" account
The Heroku app deploys into dynos
which are hosted containers running application code. The website provides access to the logs and output of the application
- Start at
https://dashboard.heroku.com/apps/<APP>
More
button -->View logs
- Logs should show no errors
The app is also available at the website provided. Once the application is confirmed to be running in the logs and the config vars are set, it is time to view the app
- Click
Open App