Per-folder Globals for Server Actions

Hi,

I’m requesting per-folder Globals. I want this feature:

For each Server Action folder.

The order of execution should be from outermost to innermost.

This would facilitate the development. For example:

POST /api/order/update?id=123

I could apply steps like Security Restrict and other more complex checks (i.e. is user allowed to access this order) directly to /api/order/, making it easier and less prone to missing security checks. In fact, this is the standard practice in modern MVC frameworks such as Laravel and AdonisJS.

Currently, I’m making a mess of Globals because I have this strategy for every resource, User, Order, etc., it’s a giant Globals - it would be best if it was scoped to each folder.

Bonus food for thought: Apply the same strategy to views (e.g. /order/update)

Wondering what would happen if you have a folder under API called order :thinking:

I didn't understand @franse

You have a folder called order under globals (this fr)

And you mention this path

I guess it's a SA under globals/order/update.json

But if you create a folder under api called order and a SA called update.json you'll have api/order/update which will be the exact same path as the one on global..

modules/global.json // (currently implemented)
api/order/update.json
api/order/_global.json

Something like that