Skip to content
Snippets Groups Projects
Commit 7f35eef1 authored by Neda Moeini's avatar Neda Moeini
Browse files

Load configuration file in app.config

parent 9cd4160e
Branches
No related tags found
1 merge request!1Feature/get graph data from gap
"""Initializes the FastAPI application."""
import os
from fastapi import FastAPI
from mapping_provider import config
from mapping_provider.api.common import router as version_router
......@@ -11,5 +13,10 @@ def create_app() -> FastAPI:
title="Mapping provider",
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)
app.include_router(version_router)
return app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment