https://github.com/agentgill/publish-platform-events-with-express
Simple Express Server for Publishing Salesforce Platform events
https://github.com/agentgill/publish-platform-events-with-express
Last synced: about 1 year ago
JSON representation
Simple Express Server for Publishing Salesforce Platform events
- Host: GitHub
- URL: https://github.com/agentgill/publish-platform-events-with-express
- Owner: agentgill
- Created: 2021-10-22T08:35:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-22T08:55:56.000Z (almost 5 years ago)
- Last Synced: 2025-01-18T13:38:35.099Z (over 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Express Server for Publishing Salesforce platform events
Super Simple example of using Express with Salesforce Platform Events!
## Get Started
1. Clone the repo `gh repo clone agentgill/publish-platform-events-with-express`
2. Run `npm i` to install node dependencies
3. Create .env file and add your Salesforce login detils
4. Update line 42 in app.js `.sobject('RateRequest__e')` to be your own Platform Event object
5. Run `node app.js` or `npx nodemon app.js` to start your local server
6. Install VSCode Extension **Thunder Client** or download Postman
7. Post some JSON to the endpoint and watch it magically appear in your Salesforce Platform Event
8. Install Streaming Monitor in Salesforce to easily view Platform Events you post
## Example .env file
```env
username=mysalesforceuser@salesforce.com
password=mypassword
```
## Example Rest POST
```rest
POST https://localhost:3000 HTTP/1.1
content-type: application/json
{
"Hello": "World",
}
```