This repo includes a Node.js app, which features a vehicle dashboard and demonstrates how to use the High Mobility GraphQL API.
Step 0: Make sure you have this sample app deployed. Once you load the root URL, you will be presented to configure it.
- Go to high-mobility.com and create an account or sign in
- Create a Cloud App under the Develop tab. For exact details, have a look at the Create App step in our docs.
- Choose the Client Certificate tab and then the GraphQL tab as shown in the screenshot below.
- Second, you need to insert the OAuth2 configuration, which you will find under My Settings/Team Settings > OAuth Client. Note that for Cloud Apps created under the Production tab, the OAuth2 configuration is listed directly in the app details view.
- In the same OAuth2 page, add the Redirect URI that is listed at the end of the configuration form of this app. This way you are redirected back to the app once the consent flow has finished.
- For fleet apps you will also need to insert fleet config. To download the JSON open your production app, then the service account keys tab, then click on the "+" button to download the config.
- After initializing your app and adding a vehicle, click on the refresh button to refresh the vehicle's fleet clearance status. To automatically update this status, configure a webhook in the settings view.
- Node 16.14
- Postgres database
npm i
cp .env.example .env
- Add database credentials to .env
npx knex migrate:latest
npm start
cd client
npm i
npm start
3. Go to http://localhost:3000
npx knex migrate:make my_first_migration
npx knex migrate:latest
npx knex migrate:rollback --all
node generateConfig && cd client && npm i
When deployed behind a reverse proxy (like haproxy or nginx) requires the rewrite of the host header in the configuration of the reverse proxy, for connections towards the backend.
http-request set-header Host "your.fixed.hostname"
proxy_set_header Host "your.fixed.hostname";
(see https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header)
We would love to accept your patches and contributions to this project. Before getting to work, please first discuss the changes that you wish to make with us via GitHub Issues or Slack.
See more in CONTRIBUTING.md
This repository is using MIT license. See more in LICENSE