Replies: 3 comments
-
To set it up to work without the Short of actually doing the diversion of the intercept, an attempt was started for this - main...sean-start-api-routes-v2
|
Beta Was this translation helpful? Give feedback.
-
This is to do with how the Vinxi router for API Routes selects the necessary routes to split out into its own bundle and not include it in the SSR bundle. At the time of implementation, Tanner wanted the SSR bundle to be separate from the API Routes bundle. |
Beta Was this translation helpful? Give feedback.
-
I see thank you for explanation, haven't thought about vinxi's routers |
Beta Was this translation helpful? Give feedback.
-
Work in Progress!
As requested by @schiller-manuel here #2734 (comment) I'm opening this RFC to gather everything related to possible routing features like:
(group)
parentheses for groups we could consider[[optional]]
double square brackets which is inspired by NextJSapiBase
There's also #1277 (just discovered) which I think is important to keep in mind.
Copying in this question I asked on Discord (tho no one so far answered), gonna organize this whole RFC better shortly 🤓
Hey I've got a question, what's the reason for Start to require a common apiBase prefix? In Rakkas you can name any file in the route tree to foo.api.ts or index.api.ts instead of foo.page.tsx and it's an api route. Personally I'd even prefer to be able to just respond with a raw response from any beforeLoad or loader and have it render that instead of the component which I think is kinda possible in Deno's Fresh docs. This would allow for things like Deno is doing with their readme and imports where depending on if the Deno runtime is fetching the url or the browser they render an html page or return the raw source code. Tho personally I don't have a direct need for the latter currently, how our current project is structured where we generate Open Graph images in API routes which are located next to the page itself so kinda just append /og-image to most urls and you get the image. One thing I was thinking for this particular case is looking into using a server function and stuff its .url into the meta tag 🤔 Also our image resizing route is at /assets which might also be able to go into a server function? Or I'd have to move all those routes into /api and add redirects to not break existing links. Any tips?
Beta Was this translation helpful? Give feedback.
All reactions