Chapter 8: Serving Static Assets and Templates
One of the common functions of a web application is serving static files such as Cascading Style Sheets (CSS) or JavaScript (JS) files. In this chapter, we are going to learn about serving static assets from the Rocket application.
One common task for a web framework is rendering a template into HTML files. We are going to learn about using the Tera template to render HTML from the Rocket application.
In this chapter, we're going to cover the following main topics:
- Serving static assets
- Introducing the Tera template
- Showcasing users
- Working with forms
- Securing HTML forms from CSRF
Technical requirements
For this chapter, we have the same technical requirements as the previous chapter. We need ...
Get Rust Web Development with Rocket 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.