home | title | heroImage | heroText | actions | features | footer | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
Home |
/images/logo-text.svg |
|
|
MIT Licensed | Copyright © 2019-present Salvo Team |
use salvo::prelude::*;
#[handler]
async fn hello_world(res: &mut Response) {
res.render("Hello world!");
}
#[tokio::main]
async fn main() {
let router = Router::new().get(hello_world);
Server::new(TcpListener::bind("127.0.0.1:7878")).serve(router).await;
}
[package]
name = "example-hello"
version = "0.1.0"
edition = "2021"
publish = false
[dependencies]
salvo = { version = "0.37" }
tokio = { version = "1", features = ["macros"] }