Type alias ActionFunction

ActionFunction: ((req, res) => unknown | Promise<unknown>)

Type declaration

    • (req, res): unknown | Promise<unknown>
    • Action function for a context Only one action function is allowed in a context. It does mark the request as handled and will not call any other anything after it.

      Parameters

      • req: Request

        The request to execute the action for

      • res: Response

        The response to execute the action for

      Returns unknown | Promise<unknown>

      The result of the action function

      Example

      Context.current.action(function(req, res) {
      // ctx is available here via [this] keyword
      // Do something
      });

Generated using TypeDoc