@@ -52,11 +52,12 @@ def __init__(self, app, prefix=''):
5252 self .prefix = prefix
5353
5454 def __call__ (self , environ , start_response ):
55-
5655 if environ ['PATH_INFO' ].startswith (self .prefix ):
5756 environ ['PATH_INFO' ] = environ ['PATH_INFO' ][len (self .prefix ):]
5857 environ ['SCRIPT_NAME' ] = self .prefix
5958 return self .app (environ , start_response )
59+ elif environ ['PATH_INFO' ].startswith ("/healthcheck" ):
60+ return self .app (environ , start_response )
6061 else :
6162 start_response ('404' , [('Content-Type' , 'text/plain' )])
6263 return ["This url does not belong to the app." .encode ()]
@@ -65,6 +66,7 @@ def __call__(self, environ, start_response):
6566def create_app ():
6667 from project .models import db
6768 from project .views import views_bp as views_blueprint
69+ from project .views import views_hc as views_hc_blueprint
6870 environment = os .environ .get ("ENVIRONMENT" , "default" )
6971
7072 app = Flask (__name__ )
@@ -88,6 +90,7 @@ def create_app():
8890 Swagger (app , config = SWAGGER_CONFIG )
8991
9092 app .register_blueprint (views_blueprint )
93+ app .register_blueprint (views_hc_blueprint )
9194 with app .test_request_context ():
9295 db .create_all ()
9396 return app , db
0 commit comments