Skip to content
Snippets Groups Projects

Feature/get graph data from gap

Merged Neda Moeini requested to merge feature/get-graph-data-from-gap into master
3 files
+ 28
14
Compare changes
  • Side-by-side
  • Inline
Files
3
"""Initializes the FastAPI application."""
import os
"""Create a FastAPI application for the mapping provider."""
from fastapi import FastAPI
from mapping_provider import config
from mapping_provider.api.common import router as version_router
from mapping_provider.api.network_graph import router as graph_router
def create_app() -> FastAPI:
"""Create a FastAPI application."""
@@ -14,9 +12,11 @@ def create_app() -> FastAPI:
description="Mapping provider endpoints for GÉANT maps",
)
config_file = os.environ.get("CONFIG_FILE_NAME", "config.json")
with config_file.open() as f:
app.state.config = config.load(f)
# Force configuration to be loaded at startup to avoid issues with missing config
from mapping_provider.dependencies import load_config
_ = load_config()
app.include_router(version_router)
return app
app.include_router(graph_router)
return app
\ No newline at end of file
Loading