Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Change behaviour of e.g. foo/index.json.js #297

Closed
Rich-Harris opened this issue Jun 27, 2018 · 0 comments · Fixed by #301
Closed

Change behaviour of e.g. foo/index.json.js #297

Rich-Harris opened this issue Jun 27, 2018 · 0 comments · Fixed by #301

Comments

@Rich-Harris
Copy link
Member

I often find myself in a situation where I want to co-locate the code for routes like these:

  • /posts/read-this-now
  • /posts/read-this-now.json

The first one can be created by routes/posts/[slug].html or routes/posts/[slug]/index.html. (In all likelihood, it works by fetching /posts/read-this-now.json in preload.)

But the second can only be routes/posts/[slug].json.js, not routes/posts/[slug]/index.json.js, which would be more convenient as it would mean the page and the server route could occupy the same directory.

This would be a minor breaking change but I think it would be more consistent and natural.

Rich-Harris added a commit that referenced this issue Jun 28, 2018
treat foo/index.json.js as foo.json.js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant