DEV Community

Cover image for πŸ¦€ Axum - Hello World !
YellowCoder
YellowCoder

Posted on

2

πŸ¦€ Axum - Hello World !

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();
}

Enter fullscreen mode Exit fullscreen mode

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

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay