File size: 397 Bytes
bfc39e7
1ab4c61
 
 
bfc39e7
 
 
1ab4c61
 
 
 
 
fccfd79
bfc39e7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
from pathlib import Path

app = FastAPI()

app.mount("/static", StaticFiles(directory=Path("static")), name="static")
@app.get("/")
async def root():
    return FileResponse("static/index.html")

@app.post("/predict")
async def predict():
    return {"prediction": "Hello, World!"}