ApiContext

class ApiContext(val env: Environment, val req: Request, val data: Data, val logger: Logger)(source)

A container for a bunch of relevant utility classes that may be needed when responding to an API call.

The classes can be used to query the current state of the API call as well as respond to it.

Constructors

Link copied to clipboard
constructor(env: Environment, req: Request, data: Data, logger: Logger)

Properties

Link copied to clipboard
val data: Data

Readonly data store potentially populated by methods annotated with InitApi. See also: InitApiContext.

Link copied to clipboard

The current server environment, in case you need to branch logic in development vs production environments.

Link copied to clipboard

A logger which can be used to log messages into the log files.

Link copied to clipboard

Request information sent from the client.

Link copied to clipboard

Response information that will be returned to the client.