Are there plans for layout-style hooks? #8887
EthanBehrends
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on building out an API for my app and was trying to add permission checks to some of my routes. As opposed to placing this in each endpoint file, I wanted to have it apply to all children of a certain directory.
The native way to do this seems to be from within
hooks.server.js
, adding code like this:I feel like the intuitive enhancement would be to add the ability to add a
/api/admin/hooks.server.js
and have the exact same behavior as the global hooks. I feel like this would help organize things a bit.Are there plans to add something like this? I was kind of surprised to see that this wasn't yet a feature, but maybe I'm just too used to express
EDIT:
I guess I didn't look hard enough before I posted this, but I just saw that this is already an issue, oops #6731
Beta Was this translation helpful? Give feedback.
All reactions