Skip to content

Commit

Permalink
static folder added
Browse files Browse the repository at this point in the history
  • Loading branch information
arun477 committed Sep 14, 2023
1 parent 9aa266f commit 1ab4c61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
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!"}
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit 1ab4c61

Please sign in to comment.