Skip to content

Commit

Permalink
Update README_hook.md
Browse files Browse the repository at this point in the history
  • Loading branch information
steniobhz authored Oct 17, 2024
1 parent 4004646 commit 64e6905
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions gateleen-hook/README_hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,43 @@ hookHandler.enableResourceLogging(true);
```


## Query-Based Listener and Route Search

Gateleen allows searching for listeners and routes using the query parameter `q`. This simplifies filtering the registered hooks based on query parameters.

### Listener Search with `q`
Search for listeners based on a query parameter like this:

```
GET http://myserver:7012/gateleen/server/listenertest/_hooks/listeners/listener/1?q=testQuery
```

The response will contain the matching listeners. If no match is found, an empty list is returned:

**Example response with matches:**
```json
{
"listeners": [
{
"destination": "/path/to/destination",
"methods": ["GET", "POST"]
}
]
}
```

**Example response with no matches:**
```json
{
"listeners": []
}
```

### Route Search with `q`
Similarly, you can search for routes using a query parameter:

```
GET http://myserver:7012/gateleen/server/listenertest/_hooks/routes?q=testRoute
```

The response contains the matching routes, or an empty list if no match is found.

0 comments on commit 64e6905

Please sign in to comment.