File size: 386 Bytes
face243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# local_server.py
import uvicorn
from fastapi import FastAPI, Request
from handler import EndpointHandler

app = FastAPI()
handler = EndpointHandler()

@app.post("/")
async def inference(request: Request):
    data = await request.json()
    result = handler(data)
    return result

if __name__ == "__main__":
    uvicorn.run("local_server:app", host="0.0.0.0", port=8000, reload=True)