use axum::extract::Path;
use springtime::application;
use springtime_di::Component;
use springtime_web_axum::controller;
#[derive(Component)]
struct ExampleController;
#[controller]
impl ExampleController {
#[get("/")]
async fn hello_world(&self) -> &'static str {
"Hello world!"
}
#[get("/{user}")]
async fn hello_user(&self, Path(user): Path<String>) -> String {
format!("Hello {user}!")
}
}
#[tokio::main]
async fn main() {
let mut application = application::create_default().expect("unable to create application");
application.run().await.expect("error running application");
}