Compose the utilities

The modules can be used together in one Python project. The API engine's handlers receive request data and headers, according to the current project notes.

Keep responsibilities separate

Let one module handle a focused job, then pass only the information another module needs. For example, a route handler can use a token manager as part of an application flow.

from EasyModel import ApiEngine, TokenManager

tokens = TokenManager()
api = ApiEngine()

def health(data, headers):
    return {"status": "ok"}

api.get("/", health)
api.start()

This example only demonstrates the documented handler shape. Check the installed package for route response details and lifecycle behavior.

PreviousNext