Serve: [Feature Request] Add option to use html files if they exist and fallback to SPA if not

Created on 5 Feb 2018  路  2Comments  路  Source: vercel/serve

Netlify allows static index.html files to match if they exist and SPA behavior to be used if nothing matches instead of a 404 (https://www.netlify.com/docs/redirects/#history-pushstate-and-single-page-apps).

It doesn't appear serve can be used in this way currently... it appears to be full SPA w/ -s or typical match html file or 404.

Most helpful comment

I don't get it. -s or --single is for that.

All 2 comments

I don't get it. -s or --single is for that.

You are correct. This is how -s behaves.

The wording in --help threw me off: "Serve single page apps with only one index.html"

I have index.html and other html files, not only one index.html file. index.html is used as a fallback if no other routes match. The wording led me to assume index.html was used for all routes in any case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabricionaweb picture fabricionaweb  路  3Comments

Simran-B picture Simran-B  路  4Comments

arel picture arel  路  4Comments

leo picture leo  路  5Comments

ajchambeaud picture ajchambeaud  路  4Comments