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

Function main

json/json-decode-error/src/main.rs:29–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28#[actix_web::main]
29async fn main() -> std::io::Result<()> {
30 env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
31
32 log::info!("starting HTTP server at http://localhost:8080");
33
34 HttpServer::new(|| {
35 App::new().service(greet).app_data(
36 web::JsonConfig::default()
37 // register error_handler for JSON extractors.
38 .error_handler(json_error_handler),
39 )
40 })
41 .workers(2)
42 .bind(("127.0.0.1", 8080))?
43 .run()
44 .await
45}

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected