Allow custom Route export field #55140
theo-lubert
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
Draft PR: #55157 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I changed the category to "Ideas" as I actualy propose a change, with an available PR |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm trying to add a
export const customConfig = ...
to myroute.ts
(App Router), but Next.js only allowsGET
,POST
,PUT
, etcThat limitation forces me to have a separate file, that implement everything in exactly the same way, which I then export in
route.ts
like so:Which is... annoying I'd say
And I understands why this doesn't work, this not a bug, and it is even documented here (file-conventions/route), but I ask myself: why is it this strict ?
Basically what I'm wondering about is:
_test
for exemple) ?Any info on this ?
Source
I found:
Beta Was this translation helpful? Give feedback.
All reactions