cloudflare / cloudflare/cloudflare-docs

Fallback order imprecise

Open
#31,288 1 comment 0 reactions 0 assignees View on GitHub
product:pages stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Example URL(s)

https://developers.cloudflare.com/pages/configuration/serving-pages/#single-page-application-spa-rendering

### Actual Behavior

The docs state:
> If your project does not include a top-level 404.html file, Pages assumes that you are deploying a single-page application. This includes frameworks like React, Vue, and Angular. Pages' default single-page application behavior matches all incoming paths to the root (/), allowing you to capture URLs like /about or /help and respond to them from within your SPA.

### Expected Behavior

In my opinion, this is imprecise and can be confusing. It makes it sound like _all_ incoming paths get matched to root, which doesn't happen. It's a fallback. if a request for `/about` comes in, and `about.html` exists, that file is served. The request does not get matched to `/`.

Potentially a clearer way to word this would be:
Pages' default single-page application behavior matches incoming paths that do not correspond to a static resource to the root (/), allowing your application to handle routes such as /about or /help client-side from within your SPA.

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.