That's it! Our app is now a fully working website with different pages and URLs.
In this chapter, we learned how to set up static and dynamic routes. We moved our subscriptions to the routes so that they change automatically, based on the route's needs. We also used slugs to subscribe to the right posts and displayed them in the post
template. Finally, we changed our website's title so that it matches the current route.
To learn more about iron:router
, take a look at its documentation at https://github.com/EventedMind/iron-router.
You can find this chapter's code examples either at https://www.packtpub.com/books/content/support/17713 or on GitHub at https://github.com/frozeman/book-building-single-page-web-apps-with-meteor/tree/chapter5.
In the next chapter, we will take a deeper look at Meteor's session object.