File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -21,29 +21,44 @@ source "https://rubygems.org"
2121gem " hooks-ruby" , " ~> X.X.X" # Replace X.X.X with the latest version
2222```
2323
24+ Once added to your Gemfile, run:
25+
26+ ``` bash
27+ bundle install
28+ ```
29+
2430## Usage 💻
2531
2632### Basic
2733
34+ Here is a simple example of how to set up a Hooks server.
35+
36+ First, create a ` config.ru ` file:
37+
2838``` ruby
2939# file: config.ru
3040require " hooks-ruby"
3141
42+ # See the config documentation below for the full list of available options
43+ # For this example, we will just set use_catchall_route to true
3244config = {
3345 use_catchall_route: true # will use the DefaultHandler for /webhooks/* - just an example/demo
3446}
3547
48+ # Builds the Hooks application with the provided configuration
3649app = Hooks .build(config: config)
50+
51+ # Run the Hooks application when the server starts
3752run app
3853```
3954
40- Run the hooks server:
55+ Run the hooks server via puma which is the recommended server for Hooks :
4156
4257``` bash
4358bundle exec puma --tag hooks
4459```
4560
46- Send a webhook request to the server:
61+ Send a webhook request to the server in a separate terminal :
4762
4863``` bash
4964curl --request POST \
You can’t perform that action at this time.
0 commit comments