Can we register routes with handler functions instead of file based routing? #2042
Unanswered
francisashley
asked this question in
Q&A
Replies: 1 comment
-
You can register route handlers for production using You cannot add a function directly from your configuration. Rollup or any other bundler can't parse and bundle a javascript function this way. Although it would be nice to hear more why you particularly need doing this I might then be able to suggest some other alternative solutions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Last I checked (March last year) this wasn't possible. It's really frustrating to work with. Ideally all routes were registered in a single routes.ts file and customer handles passed in directly. Has this feature been added in a different way or are there prospects of adding it in the future?
Here's the thread from March.. #1089. And re-reading that thread .. the feature is already available on
devHandlers
. Surely we can make it available onhandlers
!?I've also posted about it in the nuxt repo nuxt/nuxt#24968.
Beta Was this translation helpful? Give feedback.
All reactions