# Nested Routes
While scopes are the standard way to nest configurations, Actix Web also allows you to configure routes dynamically using the configure() method. This pattern is excellent for modularizing your application.
#The Configure Pattern
You can create a configuration function that takes a &mut web::ServiceConfig. This function can then register routes, scopes, and state.
code_blocksrust
use actix_web::{web, App, HttpResponse};
fn user_config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/users")
.route("/{id}", web::get().to(|| async { HttpResponse::Ok() }))
);
}
// In App setup:
// App::new().configure(user_config)This allows you to split your routing configuration across multiple files and modules, keeping your main.rs clean.