Skip to content

heroku-examples/jj-applink-express-accounts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JJ AppLink Express Accounts

Simple Express app to query Salesforce using AppLink SDK

Assumes you have a Salesforce org that is enabled for Heroku Applink that you can try sample code in.

The key features to make this work with AppLink Service Mesh are:

  • add the service mesh buildpack
  • add Heroku config var APP_PORT
  • adjust the Procfile to launch service mesh
  • in code, bind Express to $APP_PORT

Read First

DISCLAIMER -- This is a demo, not production code. Feel free to consult the code and use it to fuel your own ideas, but please do not assume it's ready to plug into a production environment as-is.


Setup

heroku create
heroku buildpacks:add heroku/heroku-applink-service-mesh
heroku buildpacks:add heroku/nodejs
heroku addons:create heroku-applink
heroku config:set APP_PORT=3000
git push heroku main

(Set permset for Manage Applink)

heroku salesforce:connect MyOrg
heroku salesforce:publish api-spec.yaml --client-name=HerokuAPI --authorization-connected-app-name=ApplinkAccountsAccessConnectedApp --connection-name=MyOrg

(Set HerokuAPI permset)

Testing

Run this anonymous Apex:

herokuapplink.HerokuAPI herokuAPI = new herokuapplink.HerokuAPI();
herokuapplink.HerokuAPI.GetAccounts_Response response = herokuAPI.GetAccounts();
System.debug(JSON.serializePretty(response));

Cleanup

Delete the Heroku app in the web dashboard or use this command:

heroku destroy

Delete the External Service "HerokuAPI" from your Salesforce Org as explained in these instructions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published