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

Function main

unix-socket/src/main.rs:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7#[actix_web::main]
8#[cfg(unix)]
9async fn main() -> std::io::Result<()> {
10 env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
11
12 log::info!("starting HTTP server at unix:/tmp/actix-uds.socket");
13
14 HttpServer::new(|| {
15 App::new()
16 // enable logger - always register Actix Web Logger middleware last
17 .wrap(middleware::Logger::default())
18 .service(web::resource("/index.html").route(web::get().to(|| async { "Hello world!" })))
19 .service(web::resource("/").to(index))
20 })
21 .bind_uds("/tmp/actix-uds.socket")?
22 .run()
23 .await
24}
25
26#[cfg(not(unix))]
27fn main() -> std::io::Result<()> {

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected