File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 2020 service
2121 models
2222"""
23- import os
2423import sys
25- import logging
2624from flask import Flask
2725from flask_restx import Api
2826from service .common import log_handlers
27+ from service import config
2928
3029# NOTE: Do not change the order of this code
3130# The Flask app must be created
3231# BEFORE you import modules that depend on it !!!
3332
3433# Create the Flask app
3534app = Flask (__name__ )
35+ app .config .from_object (config )
3636
37+ # Turn off strict slashes because it violates best practices
3738app .url_map .strict_slashes = False
3839
39- app .config ["SECRET_KEY" ] = "secret-for-dev"
40- app .config ["LOGGING_LEVEL" ] = logging .INFO
41- app .config ["API_KEY" ] = os .getenv ("API_KEY" )
42- app .config ["ERROR_404_HELP" ] = False
43-
4440# Document the type of authorization required
4541authorizations = {
4642 "apikey" : {
Original file line number Diff line number Diff line change 1+ """
2+ Global Configuration for Application
3+ """
4+ import os
5+ import logging
6+
7+ LOGGING_LEVEL = logging .INFO
8+
9+ # Secret for session management
10+ SECRET_KEY = os .getenv ("SECRET_KEY" , "sup3r-s3cr3t-for-dev" )
11+
12+ # See if an API Key has been set for security
13+ API_KEY = os .getenv ("API_KEY" )
14+
15+ # Turn off helpful error messages that interfere with REST API messages
16+ ERROR_404_HELP = False
You can’t perform that action at this time.
0 commit comments