Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into rylew/51-debounce-pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
rylew1 authored Jun 3, 2024
2 parents b6e1e6d + 0f38c92 commit b524b96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/local.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
ENVIRONMENT=local
PORT=8080

PERSIST_AUTHORIZATION_OPENAPI=TRUE

# Python path needs to be specified
# for pytest to find the implementation code
PYTHONPATH=/api/
Expand Down
6 changes: 6 additions & 0 deletions api/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from src.api.opportunities_v1 import opportunity_blueprint as opportunities_v1_blueprint
from src.api.response import restructure_error_response
from src.api.schemas import response_schema
from src.app_config import AppConfig
from src.auth.api_key_auth import get_app_security_scheme
from src.data_migration.data_migration_blueprint import data_migration_blueprint
from src.search.backend.load_search_data_blueprint import load_search_data_blueprint
Expand Down Expand Up @@ -61,6 +62,8 @@ def register_db_client(app: APIFlask) -> None:


def configure_app(app: APIFlask) -> None:
app_config = AppConfig()

# Modify the response schema to instead use the format of our ApiResponse class
# which adds additional details to the object.
# https://apiflask.com/schema/#base-response-schema-customization
Expand All @@ -70,6 +73,9 @@ def configure_app(app: APIFlask) -> None:
app.config["SWAGGER_UI_CSS"] = "/static/swagger-ui.min.css"
app.config["SWAGGER_UI_BUNDLE_JS"] = "/static/swagger-ui-bundle.js"
app.config["SWAGGER_UI_STANDALONE_PRESET_JS"] = "/static/swagger-ui-standalone-preset.js"
app.config["SWAGGER_UI_CONFIG"] = {
"persistAuthorization": app_config.persist_authorization_openapi
}
# Removing because the server dropdown has accessibility issues.
app.config["SERVERS"] = "."
app.config["DOCS_FAVICON"] = "https://simpler.grants.gov/img/favicon.ico"
Expand Down
4 changes: 4 additions & 0 deletions api/src/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ class AppConfig(PydanticBaseEnvConfig):
# See https://flask.palletsprojects.com/en/2.2.x/api/#flask.Flask.run
host: str = "127.0.0.1"
port: int = 8080

# For the OpenAPI docs, set whether the auth tokens are stored
# across refreshes of the page. Currently we only set this to true locally
persist_authorization_openapi: bool = False

0 comments on commit b524b96

Please sign in to comment.