Spaces:
Sleeping
Sleeping
Modified app.py
Browse files- modules/app.py +6 -3
modules/app.py
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.staticfiles import StaticFiles
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
7 |
app.mount("/", StaticFiles(directory="template", html=True), name="html")
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.staticfiles import StaticFiles
|
3 |
+
from fastapi.responses import FileResponse
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
7 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
8 |
app.mount("/", StaticFiles(directory="template", html=True), name="html")
|
9 |
|
10 |
+
|
11 |
+
@app.head("/")
|
12 |
+
@app.get("/")
|
13 |
+
def index() -> FileResponse:
|
14 |
+
return FileResponse(path="/index.html", media_type="text/html")
|