def setup(self):
        self.host = self._config['host']
        self.port = self._config['port']
        self._endpoints = self._config['endpoints']
        self.app = Flask(__name__)
        self.trigger_ref = TRIGGER_REF
        self.log = self._sensor_service.get_logger(__name__)

        @self.app.route('/status')
        def status():
            return json.dumps({'response': 'OK'})

        @self.app.route('/webhooks/<path:endpoint>', methods=['POST'])
        def build_events(endpoint):

            if self._endpoints not in endpoint:
                self.log.error('Ignoring unknown endpoint : %s', endpoint)
                abort(404)

            webhook_body = request.get_json()
            payload = {}
            payload['headers'] = self._get_headers_as_dict(request.headers)
            payload['body'] = webhook_body

            response = self._sensor_service.dispatch(self.trigger_ref, payload)
            self.log.debug(json.dumps(response))
            return json.dumps({'response': 'triggerposted'})
dataset/ETHPy150Open StackStorm/st2contrib/packs/circle_ci/sensors/webhook_sensor.py/CircleCIWebhookSensor.setup/swapped operands of `not in`