Instructions
- Clone the following Node.js project from GitHub: https://github.com/heroku-examples/lumina-solar-api
- Create an Heroku application, provision a Heroku Postgres add-on, and deploy the Node.js API project using Git
💡 Tip: Use your username as prefix for app name to make it unique
jduque-lumina-solar
💡 Tip: For local development you can fetch the database configuration by running:
heroku config --shell > .env
- Import the database schema using by running
npm run setup- Seed the database using
node data/seed.js- Verify the Node.js API is working by running:
heroku open - On your Salesforce org, create an External Credential with a Named Principal and then a Named Credential for the Node.js API project
- Create a Permission Set allowing the Named Principal
- Create an External Service that uses the Named Credential and fetch the api spec using the relative url:
eg: https://jduque-lumina-api-08992d919b13.herokuapp.com/api-docs/json
- On your Salesforce org, create a Flow or Apex Class that executes the External Service and displays the systems data using the
getApiSystemsmethod.