Skip to main content
Session.endpoint(
    route: str,
    *,
    method: Literal[‘DELETE’, ‘GET’, ‘PATCH’, ‘POST’, ‘PUT’] = 'GET',
) → Callable[[Callable[[Request, User, Session], JsonValue]], Callable[[Request, User, Session], JsonValue]]
Create a custom endpoint at f"/proxy/{route}".
Calling this method overrides atoti.Session.proxy’s url.
The endpoint logic is written in Python but the endpoint is exposed by Atoti Server. This allows to deploy the project in a container or a VM with a single opened port (the one of Atoti Server) instead of two. The decorated function must:

Parameters

route

The template of the path after "/proxy". For instance, if "foo/bar" is passed, a request to "/proxy/foo/bar?query=string" will match. Path parameters can be configured by wrapping their name in curly braces in the template.

method

The HTTP method the request must be using to trigger this endpoint. DELETE, PATCH, POST, and PUT requests can have a body but it must be JSON.
The full flow is: