MCPcopy Create free account
hub / github.com/actix/examples / app_config

Function app_config

forms/form/src/main.rs:20–31  ·  view source on GitHub ↗
(config: &mut web::ServiceConfig)

Source from the content-addressed store, hash-verified

18}
19
20fn app_config(config: &mut web::ServiceConfig) {
21 config.service(
22 web::scope("")
23 .app_data(web::Data::new(AppState {
24 foo: "bar".to_owned(),
25 }))
26 .service(web::resource("/").route(web::get().to(index)))
27 .service(web::resource("/post1").route(web::post().to(handle_post_1)))
28 .service(web::resource("/post2").route(web::post().to(handle_post_2)))
29 .service(web::resource("/post3").route(web::post().to(handle_post_3))),
30 );
31}
32
33async fn index() -> Result<HttpResponse> {
34 Ok(HttpResponse::Ok()

Callers

nothing calls this directly

Calls 1

postFunction · 0.85

Tested by

no test coverage detected