TestController

struct TestController : APIRouteCollection

The collection of /api/v3/test/* route endpoints and handler functions for unit testing and benchmarking purposes.

Note

These endpoints are NOT intended as API for client development.

RouteCollection Conformance

Open Access Handlers

  • getUsersHandler(_:) Asynchronous

    GET /api/v3/test/getusers

    Returns the first 10 users in the database.

    Declaration

    Swift

    func getUsersHandler(_ req: Request) async throws -> [User]

    Parameters

    req

    The incoming Request, provided automatically.

    Return Value

    An array of at most the first 10 User models in the database.

  • GET /api/v3/test/getregistrationcodes

    Returns an array of all stored RegistrationCode models. If called in a production environment, the actual codes are sanitized before return.

    Declaration

    Swift

    func getRegistrationCodesHandler(_ req: Request) async throws -> [RegistrationCode]

    Parameters

    req

    The incoming Request, provided automatically.

    Return Value

    An array of the RegistrationCoe models in the databases.