Spaces:
Build error
Build error
Create app/main.py
Browse files- app/main.py +11 -0
app/main.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from fastapi.staticfiles import StaticFiles
|
| 3 |
+
|
| 4 |
+
app = FastAPI()
|
| 5 |
+
|
| 6 |
+
# Serve the React app
|
| 7 |
+
app.mount("/", StaticFiles(directory="frontend/build", html=True), name="static")
|
| 8 |
+
|
| 9 |
+
@app.get("/api")
|
| 10 |
+
async def root():
|
| 11 |
+
return {"message": "Hello from FastAPI"}
|