Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from pydantic import BaseModel
|
|
|
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
|
@@ -13,4 +14,8 @@ def read_root(text_rating: TextRatingRequest):
|
|
| 13 |
rating = text_rating.rating
|
| 14 |
return {"Hello": "World!"}
|
| 15 |
|
| 16 |
-
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from pydantic import BaseModel
|
| 3 |
+
from fastapi.staticfiles import StaticFiles
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
|
|
|
| 14 |
rating = text_rating.rating
|
| 15 |
return {"Hello": "World!"}
|
| 16 |
|
| 17 |
+
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 18 |
+
|
| 19 |
+
@app.get("/")
|
| 20 |
+
def index() -> FileResponse:
|
| 21 |
+
return FileResponse(path="/app/static/index.html", media_type="text/html")
|