Understanding Rocket routes
We begin our chapter by discussing how Rocket handles incoming requests in the form of routes. We write functions that can be used to handle incoming requests, put route attribute above those functions, and attach the route handling functions to the Rocket. A route has an HTTP method and a URI, which corresponds to the URL path and URL query. The URI can be static, dynamic, or a combination of both. As well as a URI, there are other parameters in a route: rank, format, and data. We'll talk about them in detail later, but first, let's see how we can write a route in our code. Just like previously, let's create a new Rust application and add Rocket as a dependency. After that, let's add the following lines in the src/main.rs
file:
#[macro_use]
extern crate rocket;
use rocket::{Build, Rocket};
#[derive(FromForm)]
struct Filters {
age: u8,
active: bool,
}
#[route(GET...