Adding a service¶
Let’s say, for example, you want to process hooks from a service called Foobar.
- Create a
foobarfolder inside theservicesfolder - Inside it, create a file named
foobar.pywith the following contents:
from ..base import BaseService
class FoobarService(BaseService):
@property
def event(self):
return self.request.headers['X-GITHUB-EVENT']
- Modify the
eventproperty 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.requestandself.bodyto do whatever you want.
- Still in the
foobarfolder, create a__init__.pywith the following contents:from .foobar import FoobarService