A simple Node.js application that demonstrates webhook processing in a Heroku environment. This is a proof of concept for a background job processing system.
For this POC, we're using a simplified architecture:
- Express web server that receives webhook trigger requests
- In-memory job queue for demonstration purposes
- Asynchronous job processing using setTimeout
The app simulates a job queue system without external dependencies, making it simple to understand and deploy.
- Create a Heroku app:
heroku create
- Deploy to Heroku:
git push heroku main
To trigger a webhook, send a POST request to /trigger-webhook
:
curl -X POST https://your-app-name.herokuapp.com/trigger-webhook
This will add a job to the in-memory queue and process it asynchronously, calling the configured webhook URL.
You can use the following endpoints to monitor jobs:
GET /jobs
- List all jobsGET /job/:id
- Get status of a specific jobGET /
- Health check endpoint
You can also view the logs:
heroku logs --tail