"""Manual Adjustment flask app.""" from flask import Flask from owslogger import flask_logger from owsrequest import flask_request from manualadjustment import config class AdjustmentApp(Flask): """Custom Flask app class.""" def process_response(self, response): """Process the response. Since this is a microservice, make sure the response has the mimetype headers. Args: response (Response): handler response object. Returns: Response: updated response with mimetype header. """ Flask.process_response(self, response) response.mimetype = 'application/json' return response application = AdjustmentApp(config.SERVICE_NAME) flask_logger.setup( application, config.ENVIRONMENT, config.LOGGER_NAME, config.LOGGER_LEVEL, config.SERVICE_NAME, config.SERVICE_VERSION, exclude_paths=[config.HEALTH_CHECK]) try: import uwsgi # noqa uwsgiRunning = True except ImportError: uwsgiRunning = False flask_request.setup( application, config.ENVIRONMENT, uwsgi_cache_enabled=uwsgiRunning, add_request_context=True)