URLs with __
prefix
#4282
-
If I really, really need a set of pages to be served at, for example, The use-case is to serve my existing infrastructure - I'm transitioning to SvelteKit, but my servers are set up to call It was suggested that I use a wildcard route ( Is there another option available to me? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This works, but it's rather clunky (see Stackblitz): [__health].svelte
[__health].js
The advantage is that I can define as many of these 'special' routes as I want, and make the filenames appear very similar to the eventual URL, which is nice. The biggest drawback is that by adding a |
Beta Was this translation helpful? Give feedback.
-
Following some clarification from @geoffrich here, I can now simplify health.svelte to this:
I imagine this is as terse as I can get it. So in effect, the only concession I need to make to work around the reserved-double-underscore-prefix issue is that I'd still welcome comments on this approach vs. other alternatives. Thanks! |
Beta Was this translation helpful? Give feedback.
Following some clarification from @geoffrich here, I can now simplify health.svelte to this:
I imagine this is as terse as I can get it. So in effect, the only concession I need to make to work around the reserved-double-underscore-prefix issue is that
__health.svelte
becomes[__health].svelte
with a fallthrough if the path isn't exactly/__health
.I'd still welcome comments on this approach vs. other alternatives. Thanks!