https://github.com/paulpascal/webhook_executor
This lightweight express app that facilitates the handling of webhook requests by executing an appropriate command for each webhook.
https://github.com/paulpascal/webhook_executor
express json webhook webhook-server
Last synced: 3 months ago
JSON representation
This lightweight express app that facilitates the handling of webhook requests by executing an appropriate command for each webhook.
- Host: GitHub
- URL: https://github.com/paulpascal/webhook_executor
- Owner: paulpascal
- License: apache-2.0
- Created: 2024-01-20T16:17:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-20T23:56:45.000Z (over 1 year ago)
- Last Synced: 2025-07-22T21:17:35.812Z (6 months ago)
- Topics: express, json, webhook, webhook-server
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Project Name
Webhook Executor
# Description
This lightweight project facilitates the handling of webhook requests by executing an appropriate command for each webhook. It operates based on configurations provided in the `hooks.json` file.
# Configuration
In the `hooks.json` file, define hooks with the following structure:
```json
[
{
"id": "hook_id",
"commandPath": "/var/www/apps/project/script/deploy.sh",
"workingDirectory": "/var/www/apps/project"
}
]
```
Hooks are verified at launch time, and only valid ones (with existing `id`, `commandPath`, and `workingDirectory`) are loaded.
# Environment Variables
Customize the behavior of the project by setting the following environment variables:
```env
PORT=5555 # Specify the port for the webhook server.
MAX_REQUEST_PER_WINDOWS=1 # Set the maximum number of requests allowed in a defined time window.
WINDOWS_SIZE_IN_MS=120000 # Define the size of the time window in milliseconds (2 * 60 * 1000).
```
# Getting Started
1. Clone the repository: git clone https://github.com/paulpascal/webhook_executor.git
2. Install dependencies: npm install
3. Set up the `hooks.json` file with your webhook configurations.
4. Customize environment variables if needed.
5. Start the server: `npm start`
# Contribution Guidelines
Contributions are welcome! Follow these steps:
1. Fork the project.
2. Create a new branch: `git checkout -b feature/your-feature`
3. Commit your changes: `git commit -m 'Add your feature'`
4. Push to the branch: `git push origin feature/your-feature`
5. Submit a pull request.
# License
This project is licensed under the Apache License.