Disable recursive routes in server-side router #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I was playing around with this tutorial, and I had trouble getting the posts section to work using the server side rendering. It would crash each time I attempted to load
http://localhost:3030/posts/1
. Client-side rendering worked fine.I tracked the issue down to recursive route handling in Director. It looks like both the
/posts
and/posts:id
routes were being applied, causing a mismatch in callback parameters and subsequent crash.It's hard to say, but this may have been a change on Director's part. According to their README, server-side routing has 'backwards' recursion turned on by default. Looking at the code, however, it is set to 'forward.' And it seems to have been changed in an unrelated commit that didn't update the README.
This pull request just configures the DirectorRouter to disable recursive routes, after which the tutorial works on both client- and server-side loads.
Also, thank you for putting this tutorial together. It has been a huge help in wrapping my head around this architecture. Cheers,
-Will