Chapter 2Routing Views with Hash Events

In the last chapter, we deployed the first version of our web application…but it’s really more of a static website. The call to action button doesn’t do anything, and we only have one view. We need to add more views to our app, but we also need these views to be dynamic, responding to the user’s actions and providing an interactive experience.

On a static website, the content on each page is fixed, and navigation is controlled through hyperlinks to other pages. Traditional MVC web frameworks improve this by using a server-side router that associates URLs with controllers, which use views and models to create dynamic content. Single page apps improve upon this even further by moving the routing logic into ...

Get Serverless Single Page Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.