# import main things from fastapi import Depends, FastAPI, Body from fastapi.responses import JSONResponse, HTMLResponse from uvicorn import run from utils import predict # initing things app = FastAPI() @app.get("/") @app.post("/") async def root(): return JSONResponse({"detail":"Not Found"}, 404) @app.get("/amino-captcha-ocr/api/v1/autoregister/version") async def v(): return {"v": 4, "l": ""} @app.get("/amino-captcha-ocr/api/v1/predict") async def resolveGet(): return JSONResponse({"detail":"Use POST instead GET"}, 400) @app.post("/amino-captcha-ocr/api/v1/predict") async def resolvePost(data = Body()): return await predict(data["url"]) run(app, host="0.0.0.0", port=80)