hello_world/hello_world.rs
1//! A minimal "Hello, World!" server using Axeon
2//!
3//! This example demonstrates how to create a basic server that responds with
4//! "Hello, World!" for all requests.
5
6use axeon::{Response, Server};
7
8fn main() {
9 let mut app = Server::new();
10
11 // Add a route that handles GET requests to "/"
12 app.get("/", |_req| async { Response::text("Hello, World!") });
13
14 app.listen("127.0.0.1:3000")
15 .expect("Server failed to start");
16}