Skip to content

Commit

Permalink
Add path
Browse files Browse the repository at this point in the history
Some black formatting was applied as well.
  • Loading branch information
kdwarn committed Jun 16, 2023
1 parent 8c84c33 commit e7556a8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@


@app.post(f"{URL_PATH}/uploadfiles/")
async def create_upload_files(
files: list[UploadFile], background_tasks: BackgroundTasks
):
async def create_upload_files(files: list[UploadFile], background_tasks: BackgroundTasks):
files.sort(key=lambda f: os.path.splitext(f.filename)[1])
for file in files:
with open(file.filename, "wb") as buffer:
Expand Down Expand Up @@ -52,10 +50,9 @@ def cleanup():
os.remove(file)


app.mount("/", StaticFiles(directory="app/static",
html=True), name="static")
app.mount(f"{URL_PATH}/", StaticFiles(directory="app/static", html=True), name="static")


@app.get("/")
@app.get(f"{URL_PATH}/")
async def read_index():
return HTMLResponse('app/static/index.html')
return HTMLResponse("app/static/index.html")

0 comments on commit e7556a8

Please sign in to comment.