This connects the chargEV App CloudKit Backend to chargev-db.
Use the chargEV DB API CLI:
./api-cli.ts --generate --source 0 --client chargEVApp --type CKCheckIn
Create a .env
file for development:
GE_API_KEY=<here your GoingElectric API Auth Key>
CHARGEV_DB_API_JWT=<here the chargev-db JWY Auth Key>
CHARGEV_DB_API_URL=http://localhost:3001/api/v1
CLOUDKIT_KEY_ID=<here your cloudkit key>
CLOUDKIT_CONTAINER=iCloud.info.lazar.EVPlugFinder
CLOUDKIT_ENV=development
This App is currently deployed on Heroku:
https://dashboard.heroku.com/apps/chargev-db-cloudkit-connector
For production set the same env vars listen in the .env
file using e.g. heroku config:add
.
Make sure you create a config var for the PEM file:
heroku config:add CLOUDKIT_PRIVATE_KEY_FILE="$(cat eckey.pem)"
Then use the supplied targets in package.json
to create the key file on the local filesystem:
npm run create-cloudkit-key
Note: this hook will be called automatically after each npm install
as well.