Chapter 3. Using static assets
This chapter covers
- Transitioning from server-rendered views to a static asset SPA
- Examining the differences between server rendering and client-side rendering
- Exploring how Sails uses asset routes
- Understanding the static asset pipeline
- Setting up fake responses and loading states for frontend requests
Your development environment is installed, and you’ve taken Sails for a quick spin. You’re now ready to get down to the business of creating an application. You need to answer some initial questions:
- What types of user-agent will your application need to support?
- Will Sails be responsible for delivering frontend assets and, if so, how?
This chapter will help you answer those questions and explore in detail ways Sails can deliver frontend assets in a web application. Many great libraries and frameworks work well with Sails. We chose jQuery as a proxy for client-side DOM manipulation tools and Angular as a proxy for client-side frameworks. In this chapter, we’ll use both to demonstrate how to integrate DOM manipulation tools like jQuery and client-side JavaScript frameworks into the static asset pipeline. The remaining chapters will focus on Angular on the frontend.