statik icon indicating copy to clipboard operation
statik copied to clipboard

Add `pushState` compliant option

Open ArnaudRinquin opened this issue 10 years ago • 0 comments

The pushState option make it easy to use statik to serve single page application in dev mode.

Serving single page apps usually manipulate the browser history and allow the user to be on urls such as foobar.com/items/12/details. When trying to directly load this url, your browser will try to fetch the complete URL while what it should do is actually get foobar.com/index.html.

This is exactly what this option does: if a request URL doesn't lead to an existing file, load index.html instead.

The implementation simply relies on a existing connect-pushstate middleware that does everything for us ; we just use it or not depending on config.

This PR also contains a very few fixes in example and documentation for the new feature.

ArnaudRinquin avatar Dec 21 '15 11:12 ArnaudRinquin