bananaml / potassium

An HTTP serving framework by Banana
Apache License 2.0
97 stars 9 forks source link

Setting up multiple routes #11

Open karlbernard2 opened 1 year ago

karlbernard2 commented 1 year ago

Hi, I've been trying to use this project as an alternative to Fastapi, however I'm unable to setup multiple routes.

Is this suppose to work?

@app.handler('/health',gpu=False) def handler(context: dict, request: Request) -> Response: return Response( json = {"health": 'OK'}, status=200 )

@app.handler('/',gpu=True) def handler(context: dict, request: Request) -> Response: ...