23 releases

0.6.0 Dec 22, 2023
0.5.1 May 15, 2023
0.4.7 Mar 19, 2023
0.4.4 Nov 7, 2022
0.3.3 Nov 25, 2021

#1 in #hyper-server

Download history 71481/week @ 2024-01-29 67445/week @ 2024-02-05 68450/week @ 2024-02-12 75269/week @ 2024-02-19 77267/week @ 2024-02-26 73370/week @ 2024-03-04 84926/week @ 2024-03-11 84852/week @ 2024-03-18 89190/week @ 2024-03-25 84162/week @ 2024-04-01 87081/week @ 2024-04-08 98149/week @ 2024-04-15 97642/week @ 2024-04-22 75215/week @ 2024-04-29 89648/week @ 2024-05-06 86257/week @ 2024-05-13

351,634 downloads per month
Used in 74 crates (66 directly)

MIT license

81KB
1.5K SLoC

License Crates.io Docs

axum-server

axum-server is a hyper server implementation designed to be used with axum framework.

This project is maintained by community independently from axum.

Features

  • HTTP/1 and HTTP/2
  • HTTPS through rustls.
  • High performance through hyper.
  • Using tower make service API.
  • Very good axum compatibility. Likely to work with future axum releases.

Usage Example

A simple hello world application can be served like:

use axum::{routing::get, Router};
use std::net::SocketAddr;

#[tokio::main]
async fn main() {
    let app = Router::new().route("/", get(|| async { "Hello, world!" }));

    let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
    println!("listening on {}", addr);
    axum_server::bind(addr)
        .serve(app.into_make_service())
        .await
        .unwrap();
}

You can find more examples here.

Minimum Supported Rust Version

axum-server's MSRV is 1.63.

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

This project is licensed under the MIT license.

Dependencies

~8–22MB
~276K SLoC