Spaces:
Sleeping
Sleeping
Create backend.py
Browse files- backend.py +11 -0
backend.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from fastapi.responses import HTMLResponse
|
| 3 |
+
from fastapi.staticfiles import StaticFiles
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
app.mount("/static", StaticFiles(directory=".", html=True), name="static")
|
| 7 |
+
|
| 8 |
+
@app.get("/", response_class=HTMLResponse)
|
| 9 |
+
def root():
|
| 10 |
+
with open("index.html","r") as f:
|
| 11 |
+
return f.read()
|