🦀 Axum – Hello World !

Rmag Breaking News

Axum is a web application framework that focuses on ergonomics and modularity.

This yellowcoder-tibbit tells you about a simple Axum – “Hello World!” examples you can get quickly started with by following steps given in repo.

use axum::{response::Html, routing::get, Router};

#[tokio::main]
async fn main() {

let app = Router::new().route(“/”,get(||async {
Html(
<h1>Hello World</h1>
<h2>Here Rust Server is running….</h2>
Author: <strong>Yellow Coder</strong>
)

}));

let listener = tokio::net::TcpListener::bind(“127.0.0.1:3000”).await.unwrap();

axum::serve(listener,app).await.unwrap();
}

GitRepo : https://github.com/shubhamlodhi/rusty-fork.git

Leave a Reply

Your email address will not be published. Required fields are marked *