Skip to content

Commit 364db87

Browse files
committed
notes
1 parent b626ed3 commit 364db87

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,44 @@ source "https://rubygems.org"
2121
gem "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
3040
require "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
3244
config = {
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
3649
app = Hooks.build(config: config)
50+
51+
# Run the Hooks application when the server starts
3752
run 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
4358
bundle 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
4964
curl --request POST \

0 commit comments

Comments
 (0)