Function trillium_async_std::config

source ·
pub fn config() -> Config<AsyncStdServer, ()>
Expand description

Configures a server before running it


The default configuration is as follows:

  • port: the contents of the PORT env var or else 8080
  • host: the contents of the HOST env var or else “localhost”
  • signals handling and graceful shutdown: enabled on cfg(unix) systems
  • tcp nodelay: disabled
  • tls acceptor: none


let stopper = trillium_async_std::Stopper::new();
    .with_acceptor(()) // see [`trillium_rustls`] and [`trillium_native_tls`]
    .run(|conn: trillium::Conn| async move {
        conn.ok("hello async-std")

See [trillium_server_common::Config] for more details