def health_check_middleware(app):

    @wrappers.Request.application
    def health_check_intercept_wrapper(request):
        """Capture a request to /_ah/health and respond with 200 OK."""
        if request.path == '/_ah/health':  # Only intercept exact matches.
            return wrappers.Response('healthy', status=httplib.OK)
        else:
            return app

    return health_check_intercept_wrapper
Intercept requests to /_ah/health and respond healthy (200 OK).
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-vmruntime/vmruntime/middleware.py/health_check_middleware