"""Server.""" from flask import Flask from owslogger import flask_logger from owsrequest import flask_request from features import config app = Flask(config.SERVICE_NAME) flask_logger.setup( app, 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( app, config.ENVIRONMENT, add_request_context=True, uwsgi_cache_enabled=uwsgiRunning, label_profile=True, verify_access=True, rules_file='features/access_rules.yml', access_log_only=config.ONLY_LOG_ACCESS_ERRORS, exclude_paths=[config.HEALTH_CHECK], ) # legacy global location for all feature flags relied on by test_handler.py # todo(jpenner): remove this when all split code is removed features = dict()