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)