You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the client I am trying to use a simple backbone single-page app using pushState=true.
I'm having trouble figuring out the routing to keep node/express/compound from getting involved with anything other than the api. I've heard some mention of a wildcard route like '*' used in low-level express, maybe something like this:
When I tried doing something like map.get('', ...) and checked the route table with 'compound routes' it seemed that the '' was being treated as a string literal and it was trying to map a path like '/*', rather than recognizing it as a wildcard.
Is there some equivalent in railway-routes/compoundjs for this? Ultimately I want to preserve a request such as '/targets' or '/targets/3', server should just ignore or serve index.html and let backbone read the '/targets/3' and handle it with its client-side routing. I'm also concerned that using something like "res.sendfile('index.html')" would change the url before the client see's it, stripping the 'targets/3' before backbone can respond to it.
I found some similar Q&A on Stack Overflow but nothing that seemed to be specific to compoundjs or railway-routes.
Any suggestions, or documentation links would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
I'm using compoundjs to serve a RESTful api. I'm using an 'api' namespace to handle the REST calls like this:
On the client I am trying to use a simple backbone single-page app using pushState=true.
I'm having trouble figuring out the routing to keep node/express/compound from getting involved with anything other than the api. I've heard some mention of a wildcard route like '*' used in low-level express, maybe something like this:
When I tried doing something like map.get('', ...) and checked the route table with 'compound routes' it seemed that the '' was being treated as a string literal and it was trying to map a path like '/*', rather than recognizing it as a wildcard.
Is there some equivalent in railway-routes/compoundjs for this? Ultimately I want to preserve a request such as '/targets' or '/targets/3', server should just ignore or serve index.html and let backbone read the '/targets/3' and handle it with its client-side routing. I'm also concerned that using something like "res.sendfile('index.html')" would change the url before the client see's it, stripping the 'targets/3' before backbone can respond to it.
I found some similar Q&A on Stack Overflow but nothing that seemed to be specific to compoundjs or railway-routes.
Any suggestions, or documentation links would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: