Extend a route
⚠️ This page is relevant only if you installed Forest Admin directly on a database (SQL/Mongodb). If you installed in a Rails app, check the "Override a route" page.
Last updated
Was this helpful?
⚠️ This page is relevant only if you installed Forest Admin directly on a database (SQL/Mongodb). If you installed in a Rails app, check the "Override a route" page.
Last updated
Was this helpful?
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize
and forest-express-mongoose
Node.js agents that will soon reach end-of-support.
forest-express-sequelize
v9 and forest-express-mongoose
v9 are replaced by v1.
Please check your agent type and version and read on or switch to the right documentation.
Extending a route is a clean way to achieve more by building on top of Forest Admin's existing routes.
To extend a route, simply add your own logic before the next()
statement:
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 Admin:
Using a message broker - such as RabbitMQ or Kafka - to broadcast events is current practice.
At some point, you may want to trigger your remote logic after Forest Admin's logic.
Here is how you could be using to handle orders
synchronization across multiple channels:
To achieve this, you can manually recreate next()
's behavior by using the snippets of , then append your own logic.