📜  rust lang server - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:48.892000             🧑  作者: Mango

代码示例1
// Install rocket and add to your Cargo.toml

#[macro_use] extern crate rocket;

#[get("/hello//")]
fn hello(name: &str, age: u8) -> String {
    format!("Hello, {} year old named {}!", age, name)
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![hello])
}