Woodshop
Search…
Override the count route
This example shows you how to override the count default route. Forest Admin comes packaged with a set of existing routes, which execute Forest Admin's default logic. At installation, they are generated in /routes.

Requirements

    An admin backend running on forest-express-sequelize

How it works

Directory: /routes

This directory contains the users.js files where the routes are declared.
To override the count route, simply remove the next() statement and add your own logic:
/routes/users.js
1
//...
2
3
router.get('/users/count', permissionMiddlewareCreator.list(), (request, response, next) => {
4
response.send({ count: 100000000 });
5
});
6
7
//...
Copied!
Last modified 1yr ago