Spaces:
Sleeping
Sleeping
j
commited on
Commit
·
ed737ea
1
Parent(s):
8a75d3b
added directory listing API for debugging
Browse files
app/{list_files.html → templates/list_files.html}
RENAMED
File without changes
|
app/webservice.py
CHANGED
@@ -163,7 +163,17 @@ async def asr(
|
|
163 |
@app.get("/static", response_class=HTMLResponse)
|
164 |
def list_files(request: Request):
|
165 |
|
166 |
-
files = os.listdir("./static")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
files_paths = sorted([f"{request.url._url}/{f}" for f in files])
|
168 |
print(files_paths)
|
169 |
return templates.TemplateResponse(
|
|
|
163 |
@app.get("/static", response_class=HTMLResponse)
|
164 |
def list_files(request: Request):
|
165 |
|
166 |
+
files = os.listdir("./app/static")
|
167 |
+
files_paths = sorted([f"{request.url._url}/{f}" for f in files])
|
168 |
+
print(files_paths)
|
169 |
+
return templates.TemplateResponse(
|
170 |
+
"list_files.html", {"request": request, "files": files_paths}
|
171 |
+
)
|
172 |
+
|
173 |
+
@app.get("/app", response_class=HTMLResponse)
|
174 |
+
def list_files(request: Request):
|
175 |
+
|
176 |
+
files = os.listdir("/app")
|
177 |
files_paths = sorted([f"{request.url._url}/{f}" for f in files])
|
178 |
print(files_paths)
|
179 |
return templates.TemplateResponse(
|