Cloesce - v0.0.5-unstable.27
    Preparing search index...

    Class CloesceApp

    Index

    Constructors

    Properties

    routePrefix: string = "api"

    Methods

    • Registers middleware for a specific method on a namespace

      Runs after namespace middleware and request validation.

      Type Parameters

      • T

      Parameters

      • key: Function

        The constructor function of the Model or Service.

      • method: CrudKind | KeysOfType<T, (...args: any) => any>

        The method name or CrudKind to register the middleware for.

      • m: MiddlewareFn

        The middleware function to register.

      Returns void

    • Registers middleware for a specific namespace (Model or Service)

      Runs before request validation and method middleware, and after services are initialized.

      Parameters

      • key: Function
      • m: MiddlewareFn

        The middleware function to register.

      Returns void

    • Registers middleware than runs on every valid route.

      Runs after a route is matched, but before services are initialized.

      Parameters

      Returns void

    • Runs the Cloesce Router, handling dependency injection, routing, validation, hydration, and method dispatch.

      Parameters

      • request: Request

        The incoming Request object.

      • env: any

        The Wrangler environment bindings.

      Returns Promise<Response>

      A Response object representing the result of the request.