-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New: Add "endpoints" guide #760
Description
Our guides for creating non-HTML pages (aka "endpoints") are pretty tough to scan as a new user. Right now, we have:
- "non-HTML pages" listed on our pages docs, which I can't find by searching for "endpoint" 😕
- the "response" section at the bottom of our SSR docs; again, not find-able searching for "endpoint"
☝️ We also have different advice for endpoint return values for SSG vs. SSR. In SSR, we recommend a formatted Response object with a defined content type. In SSG, you must use a { body } object only (Response will break during builds) to output a static file. This speaks to a more fundamental issue with SSR, where it's more tacked-on than interwoven with our existing docs.
Solution: a general "endpoints" docs page would be an excellent landing spot to compare SSG and SSR approaches to non-HTML files. We are beginning to encourage .js endpoints for any clientside data fetching as well, so a dedicated page for the concept should aid in onboarding SSR users.