7 Introduction to server-side web apps in Rust
This chapter covers
- Serving a static web page with Actix
- Rendering a dynamic web page with Actix and Tera
- Adding user input with forms
- Displaying a list with templates
- Writing and running client-side tests
- Connecting to the backend web service
In chapters 3-6 of the book, we built out the Tutors web service from scratch using Rust and the Actix web framework. In this section, we’ll focus on learning the basics of building a web application in Rust.
It may sound strange that a system programming language is being used to create a web application. But that’s the power of Rust. It can straddle the worlds of system and application programming with ease.
In this chapter, you will get introduced to concepts and tools for working with Rust to build web applications. At this point it is important to recall that there are two broad techniques for building web applications - server-side rendering (SSR) and single page applications (SPA), each possibly in the form of progressive web application (PWA). In this section, we’ll focus on the former, and in later chapters we’ll cover the latter. We will not cover PWAs in this book.