Skip to content

Commit

Permalink
Add sink example
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jan 24, 2018
1 parent 8263416 commit 769718a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/sink_example.py
@@ -0,0 +1,10 @@
"""This is an example of a hug "sink", these enable all request URLs that start with the one defined to be captured
To try this out, run this api with hug sink_example.py and hit any URL after localhost:8000/all/ (for example: localhost:8000/all/the/things/
"""
import hug


@hug.sink('/all')
def my_sink(request):
return request.path.replace('/all', '')

0 comments on commit 769718a

Please sign in to comment.