Skip to main content
Extending a route is a clean way to achieve more by building on top of Forest’s existing routes. To extend a route, simply add your own logic before the next() statement:

Adding logic with an API call

The most simple way to trigger your business app’s (or any external app’s) logic is with an API call! In the following example, we override the CREATE route so that a credit card is created whenever a new customer is created in Forest:

Adding logic with a message broker

Using a message broker - such as RabbitMQ or Kafka - to broadcast events is current practice. Here is how you could be using RabbitMQ to handle orders synchronization across multiple channels:

Adding logic after Forest’s default behavior

At some point, you may want to trigger your remote logic after Forest’s logic. To achieve this, you can manually recreate next()’s behavior by using the snippets of default routes, then append your own logic.