An Express /
route serves my Backbone's app index.html
.
I'm using pushstate
in Backbone but the routes that Backbone should handled are being handled by express, giving 404
responses.
How can I setup Express to serve the index.html
but to delegate other routes to Backbone?
In this situation you have multiple options:
You can have a server that handles the same routes as the client does and returns the same results. It is hard to implement but it gives a good url. Github did this.
Always return index.html and handle the route client side. (That is somewhat ugly and hard to maintain)
Don't use pushstate. Amen.