INNER CODE UNIT · Python

exception_handler

LeslieLeung/heimdallr · main.py:27

async def exception_handler(request, exc):
    return JSONResponse({"code": 3, "message": exc.message})


if __name__ == "__main__":
    uvicorn.run(
        "main:app",
        host="0.0.0.0",
        port=get_config_int("PORT", "", 9000),
        log_level="info",
        access_log=True,
        workers=get_config_int("WORKERS", "", 1),
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…