I am following a guide over here https://youtu.be/c5OZZsVkOKY on how to integrate Salesforce OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration here but I am not using Heroku, I am using my own server.
My question is, and I know I might missed the memo on how to do this, but what is the process to run custom code from extensions/server_connect/routes? below is a screenshot of the code.
I feel like I should know how to do this but I am having brain freeze.
I also have these two npm packages just like the guide (Salesforce and sf-jwt-token) much thanks to anyone you can help me translate it into Wappler way of writing custom code and run them
@Teodor or @patrick what I am I doing wrong here. Should I have place this code in extensions/server_connect/modules instead? I am trying to run this Salesforce endpoint using jwt flow. Whats the best way to run this code?
Thanks for your reply @patrick I appreciate it I will modify as suggested. One more question at @patrick. How would I go about storing these, see image outline below as environment variable in Wappler?
You can store it in environment variables if you prefer that. In development you can set the environment variables in a .env file, we use the dotenv module for that (https://github.com/motdotla/dotenv). On your live server it depends on you host, you should not use the .env there.
So I believe at this point I might out of league here because after I saved the file it broke all the pages. Its has been broking all the page even before I added your suggestion but I wasn’t sure if it was because of not using the exports.hander way.
You can use the api action for that. Or use server connect, it will not allow you to select the url, but you can set it in code view like <dmx-serverconnect id="serverconnect1" url="testingpage2"></dmx-serverconnect>.
Thanks for this I’ll try it now. @patrick I really appreciate you and your time.
I have honestly been struggling with this code for two weeks now until I finally decided to reach out here because I just couldn’t figure it out on my own.