Skip to content

Commit

Permalink
Stub config handling
Browse files Browse the repository at this point in the history
Add site title and summary
  • Loading branch information
NeonDaniel committed Jan 13, 2024
1 parent 16d6067 commit 268f82c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions diana_services_api/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@
from diana_services_api.app.routers.api_proxy import proxy_route
from diana_services_api.app.routers.mq_backend import mq_route
from diana_services_api.app.routers.auth import auth_route
from diana_services_api.version import __version__


def create_app():
app = FastAPI()
def create_app(config: dict):
title = config.get('title') or "Diana Services API"
summary = config.get('summary') or "HTTP component of the Device Independent API for Neon Applications (DIANA)"
version = __version__
app = FastAPI(title=title, summary=summary, version=version)
app.include_router(auth_route)
app.include_router(proxy_route)
app.include_router(mq_route)
Expand Down
3 changes: 2 additions & 1 deletion diana_services_api/app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@


def main():
app = create_app()
config = dict()
app = create_app(config)
# TODO: host, port from config
uvicorn.run(app, host="0.0.0.0", port=8080)

Expand Down

0 comments on commit 268f82c

Please sign in to comment.