Service workers not only act like load balancers, as we discussed in the Selecting the best content provider (load balancer) recipe of this chapter; they can also act like virtual servers. This allows us to decouple the UI from the typical server-side business logic.
In this recipe, we are going to learn how we can move the business logic portion to a service worker responding to traditional RESTful fetch requests. To demonstrate this feature, we are going to implement a to-do app.
To get started with service workers, you will need to have the service worker experiment feature turned on in your browser settings. If you have not done this yet, refer to the first recipe of Chapter 1, Learning Service Worker Basics: Setting up service workers. Service workers only run across HTTPS. To find out how to set up a development environment to support this feature, refer to the following recipes: Setting up GitHub pages for SSL, Setting up...