File size: 435 Bytes
6b8b230 b6b104f 6b8b230 b6b104f 6b8b230 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import os
import uvicorn
from fastapi import FastAPI, Body
from fastapi.staticfiles import StaticFiles
app = FastAPI()
@app.get("/api/chat")
def chat():
return {"Hello": "World!"}
if os.getenv("ENV") == "production":
app.mount("/", StaticFiles(directory="dist", html=True), name="static")
app.get("/")(StaticFiles(directory="dist", html=True))
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=7860)
|