This commit is contained in:
@ -5,12 +5,13 @@ from flask_restful import Api
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
||||
|
||||
from healthcheck import HealthCheck
|
||||
|
||||
from config import *
|
||||
from db import db
|
||||
from marshm import ma
|
||||
from resources import SampleResource, SampleParameterResource
|
||||
from healthchecks import health_database_status
|
||||
|
||||
"""
|
||||
Main Flask RESTful APIm
|
||||
@ -42,6 +43,7 @@ app.config['FLASK_PIKA_PARAMS'] = {'host': RABBITMQ_HOST,
|
||||
'port': 5672,
|
||||
'virtual_host': '/'}
|
||||
api = Api(app)
|
||||
health = HealthCheck(app, "/healthz")
|
||||
db.init_app(app)
|
||||
ma.init_app(app)
|
||||
|
||||
@ -62,6 +64,7 @@ logger.addHandler(handler)
|
||||
api.add_resource(SampleResource, "/sample")
|
||||
api.add_resource(SampleParameterResource, '/sample/<tag>')
|
||||
|
||||
health.add_check(health_database_status)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(
|
||||
|
Reference in New Issue
Block a user