Function salvo_core::start_with_threads [−][src]
Expand description
If you don’t want to include tokio in your project directly, you can use this function to start server.
ⓘ
use salvo_core::prelude::*;
#[fn_handler]
async fn hello_world() -> &'static str {
"Hello World"
}
fn main() {
let server = Server::new(Router::new().get(hello_world)).bind(([0, 0, 0, 0], 7878));
salvo_core::start_with_threads(server, 8);
}