I've recently started learning Meteor and stumbled across SSR. So far SSR has been incredibly helpful but I've come across a scenario that I'm not sure how to handle so I thought I'd post here. I'm using SSR and Iron-Router together.
Here's the basic flow (working):
User visits the home page (path: "/")
The user clicks on an article within the page which sends off an AJAX request to SSR for the HTML section containing the blog post the user has requested (path: "/:category/:post_title")
I modify the browser history and push the home page route on the history stack so the user is still able to click the back button in their browser to view the previous page
The problem:
The user is unable to send the direct URL to a friend or bookmark the direct URL to visit later
If the user navigates to the direct URL they can only see the HTML snippet that SSR is giving me, no styling, no standard page layout, etc
I understand that I need to control for this situation in some way, my question is does SSR or Meteor have anything built in to detect this type of event? Should I have a client-side route setup that intercepts the "/:category/:post_title" route and renders that page (if this is the case how would I do this without conflicting with the server-side route)? Any pointers would be greatly appreciated!
Hello,
I've recently started learning Meteor and stumbled across SSR. So far SSR has been incredibly helpful but I've come across a scenario that I'm not sure how to handle so I thought I'd post here. I'm using SSR and Iron-Router together.
Here's the basic flow (working):
The problem:
I understand that I need to control for this situation in some way, my question is does SSR or Meteor have anything built in to detect this type of event? Should I have a client-side route setup that intercepts the "/:category/:post_title" route and renders that page (if this is the case how would I do this without conflicting with the server-side route)? Any pointers would be greatly appreciated!