generated from alecodes/base-template
feat: add axium hello world
This commit is contained in:
parent
ca2ea91976
commit
0923ac1841
3 changed files with 617 additions and 2 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -1,3 +1,10 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use axum::routing::get;
|
||||
use axum::Router;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let app = Router::new().route("/", get(|| async { "Hello, World!" }));
|
||||
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
||||
axum::serve(listener, app).await.unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue