#Are we able to override the root api/index.ts file?

9 messages · Page 1 of 1 (latest)

tall spade
#

I'm assuming this requires a custom loader

drifting wyvern
#

What would you like to override exactly ?

tall spade
#

@drifting wyvern I want to add an extra layer like admin and store routes, and have supplier routes, but I want to access the container there for the feature flags

drifting wyvern
#

You can creates the route without having to override the index file. The custom routes are loaded before the core routes meaning that you can also plug yourself before the core routes are reach through middlewares as well. From the route, you have access to req.scope which is the container

tall spade
#

thank you, I understand that, the problem is that I want to rearrange the routes

for example:

  • products under supplier and admin, products are filtered by supplier
  • categories management under admin
    ....

problem here is that I want /supplier/products

#

same services between both, but supplier/products will inject a supplier id via the middleware

#

which will filter products by supplier

#

I want to keep the featureflag route check that is already done for categories in the supplier section