Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mapping Provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
Next Generation Map
Mapping Provider
Commits
7f35eef1
Commit
7f35eef1
authored
1 month ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Load configuration file in app.config
parent
9cd4160e
Branches
Branches containing commit
No related tags found
1 merge request
!1
Feature/get graph data from gap
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mapping_provider/__init__.py
+7
-0
7 additions, 0 deletions
mapping_provider/__init__.py
with
7 additions
and
0 deletions
mapping_provider/__init__.py
+
7
−
0
View file @
7f35eef1
"""
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment