Skip to content

URLs with __ prefix #4282

Discussion options

You must be logged in to vote

Following some clarification from @geoffrich here, I can now simplify health.svelte to this:

<script context="module">
  export async function load({ url, props }) {
    if (url.pathname !== '/__health') {
      return { fallthrough: true };
    }

    return {props}
  }
</script>

<script>
export let data;
</script>

__health {data}

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!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by georgecrawford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant