This commit is contained in:
parent
80d115e488
commit
f244721cd1
11
src/app.py
11
src/app.py
@ -64,6 +64,17 @@ logger.addHandler(handler)
|
||||
api.add_resource(SampleResource, "/sample")
|
||||
api.add_resource(SampleParameterResource, '/sample/<tag>')
|
||||
|
||||
|
||||
@app.before_first_request
|
||||
def before_first_request():
|
||||
ch = fpika.channel()
|
||||
ch.exchange_declare(exchange=RABBITMQ_EXCHANGE,
|
||||
exchange_type='fanout',
|
||||
durable=True,
|
||||
auto_delete=True)
|
||||
fpika.return_channel(ch)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(
|
||||
debug=bool(DEBUG),
|
||||
|
Loading…
Reference in New Issue
Block a user