Adding a service¶
Let’s say, for example, you want to process hooks from a service called Foobar
.
- Create a
foobar
folder inside theservices
folder - Inside it, create a file named
foobar.py
with the following contents:
from ..base import BaseService
class FoobarService(BaseService):
@property
def event(self):
return self.request.headers['X-GITHUB-EVENT']
- Modify the
event
property as necessary to identify the the event sent by the service. Later you’re gonna create a script to handle this event. Inside this class you have access toself.request
andself.body
to do whatever you want.
- Still in the
foobar
folder, create a__init__.py
with the following contents:from .foobar import FoobarService