Questions & Answers

What are the available events and how can I use them?

Deepkit HTTP
50 up-votes
Warning: The answer is generated by an artificial intelligence. It might not be correct.
To adjust rating, open the thread in Discord and click on the up/down vote button.

The available events are:

  • httpWorkflow.onRequest: Triggered when a new request comes in.
  • httpWorkflow.onRoute: Triggered when the route should be resolved from the request.
  • httpWorkflow.onRouteNotFound: Triggered when the route is not found.
  • httpWorkflow.onAuth: Triggered when authentication happens.
  • httpWorkflow.onResolveParameters: Triggered when route parameters are resolved.
  • httpWorkflow.onAccessDenied: Triggered when access is denied.
  • httpWorkflow.onController: Triggered when the controller action is called.
  • httpWorkflow.onControllerError: Triggered when the controller action throws an error.
  • httpWorkflow.onParametersFailed: Triggered when route parameters resolving failed.
  • httpWorkflow.onResponse: Triggered when the controller action has been called and the result is converted to a response.

You can use these events to hook into the entire process of processing an HTTP request and modify the behavior accordingly.