Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pushState compliant option #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArnaudRinquin
Copy link

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.

@dmaevac dmaevac force-pushed the master branch 2 times, most recently from 73dd3c5 to 9da2992 Compare January 14, 2016 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants