mnist / server.py
carlfeynman's picture
static folder added
1ab4c61
raw
history blame
396 Bytes
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.get("/predict")
async def predict():
return {"prediction": "Hello, World!"}