Skip to content

Commit e17ef32

Browse files
committed
fix: root path
fix: bump siibra-python version
1 parent 60599b3 commit e17ef32

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

api/server/api.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,6 @@
6767
expose_headers=[siibra_version_header]
6868
)
6969

70-
71-
_code_meta = None
72-
@siibra_api.get("/about", include_in_schema=False)
73-
def servicemeta():
74-
global _code_meta
75-
if _code_meta is None:
76-
with open(Path(__file__).parent.parent.parent / "codemeta.json", "r") as fp:
77-
_code_meta = json.load(fp=fp)
78-
if _code_meta is None:
79-
raise Exception("code meta is not found, cannot populate servicemeta")
80-
return {
81-
"@context": "https://gitlab.ebrains.eu/lauramble/servicemeta/-/raw/main/data/contexts/servicemeta.jsonld",
82-
"type": "WebApplication",
83-
"author": _code_meta["author"],
84-
"dateModified": _code_meta["dateModified"],
85-
"documentation": DOCUMENTATION_URL,
86-
"name": _code_meta["name"],
87-
"version": _code_meta["version"],
88-
"inputFormat": INPUT_FORMAT,
89-
"outputFormat": OUTPUT_FORMAT
90-
}
91-
92-
@siibra_api.get("/", include_in_schema=False)
93-
def get_home(request: Request):
94-
"""Return the template for the siibra landing page."""
95-
return templates.TemplateResponse(
96-
"index.html", context={
97-
"request": request,
98-
"api_version": __version__,
99-
"git_hash": GIT_HASH,
100-
"versions": ["v3_0", "v2_0", "v1_0"]
101-
})
102-
10370
# Each middleware function is called before the request is processed
10471
# For FastAPI the order is important.
10572
# The functions are called (perhaps counter-intuitively) from bottom to top.
@@ -377,6 +344,39 @@ async def exception_other(request: Request, exc: Exception):
377344

378345
# it seems other mounts must be mounted **after** VersionedFastAPI is called
379346
templates = Jinja2Templates(directory="templates/")
347+
348+
_code_meta = None
349+
@siibra_api.get("/about", include_in_schema=False)
350+
def servicemeta():
351+
global _code_meta
352+
if _code_meta is None:
353+
with open(Path(__file__).parent.parent.parent / "codemeta.json", "r") as fp:
354+
_code_meta = json.load(fp=fp)
355+
if _code_meta is None:
356+
raise Exception("code meta is not found, cannot populate servicemeta")
357+
return {
358+
"@context": "https://gitlab.ebrains.eu/lauramble/servicemeta/-/raw/main/data/contexts/servicemeta.jsonld",
359+
"type": "WebApplication",
360+
"author": _code_meta["author"],
361+
"dateModified": _code_meta["dateModified"],
362+
"documentation": DOCUMENTATION_URL,
363+
"name": _code_meta["name"],
364+
"version": _code_meta["version"],
365+
"inputFormat": INPUT_FORMAT,
366+
"outputFormat": OUTPUT_FORMAT
367+
}
368+
369+
@siibra_api.get("/", include_in_schema=False)
370+
def get_home(request: Request):
371+
"""Return the template for the siibra landing page."""
372+
return templates.TemplateResponse(
373+
"index.html", context={
374+
"request": request,
375+
"api_version": __version__,
376+
"git_hash": GIT_HASH,
377+
"versions": ["v3_0", "v2_0", "v1_0"]
378+
})
379+
380380
siibra_api.mount("/static", StaticFiles(directory="static"), name="static")
381381

382382
@siibra_api.get("/metrics", include_in_schema=False)

requirements/siibra.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
siibra==0.4a83
1+
siibra==0.4a84
22
plotly

0 commit comments

Comments
 (0)