File size: 324 Bytes
e212778
 
 
 
 
 
 
 
 
 
 
 
 
 
852b422
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastapi import FastAPI, Body
from uvicorn import run
from utils import predict

app = FastAPI()

@app.post("/predict")
async def resolvePost(data = Body()):
    return await predict(data["url"])
    
@app.get("/predict")
async def resolveGet(url: str):
    return await predict(url)

run(app, host="0.0.0.0", port=7860)