Skip to content

Commit afa649e

Browse files
authored
Merge pull request #542 from OpenMined/fix_template_paths
Fix template paths
2 parents b514fd4 + 7511940 commit afa649e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

syftbox/server/api/v1/main_router.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async def list_datasites(
6969
request: Request, server_settings: ServerSettings = Depends(get_server_settings)
7070
) -> HTMLResponse:
7171
files = get_file_list(server_settings.snapshot_folder)
72-
template_path = current_dir / "templates" / "datasites.html"
72+
template_path = current_dir.parent.parent / "templates" / "datasites.html"
7373
html = ""
7474
with open(template_path) as f:
7575
html = f.read()
@@ -137,7 +137,7 @@ async def browse_datasite(
137137

138138
if os.path.isdir(slug_path):
139139
files = get_file_list(slug_path)
140-
template_path = current_dir / "templates" / "folder.html"
140+
template_path = current_dir.parent.parent / "templates" / "folder.html"
141141
html = ""
142142
with open(template_path) as f:
143143
html = f.read()
@@ -189,13 +189,13 @@ async def log_event(
189189

190190
@main_router.get("/install.sh")
191191
async def install() -> FileResponse:
192-
install_script = current_dir / "templates" / "install.sh"
192+
install_script = current_dir.parent.parent / "templates" / "install.sh"
193193
return FileResponse(install_script, media_type="text/plain")
194194

195195

196196
@main_router.get("/icon.png")
197197
async def icon() -> FileResponse:
198-
icon_path = current_dir / "assets" / "icon.png"
198+
icon_path = current_dir.parent.parent / "assets" / "icon.png"
199199
return FileResponse(icon_path, media_type="image/png")
200200

201201

0 commit comments

Comments
 (0)