Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from fastapi.responses import HTMLResponse
|
| 3 |
+
import uvicorn
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
@app.get("/", response_class=HTMLResponse)
|
| 8 |
+
def serve_index():
|
| 9 |
+
with open("index.html", "r") as file:
|
| 10 |
+
return file.read()
|
| 11 |
+
|
| 12 |
+
if __name__ == "__main__":
|
| 13 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|