Initial Commit
This commit is contained in:
17
src/main.rs
Normal file
17
src/main.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::error::Error;
|
||||
|
||||
use axum::routing::get;
|
||||
use axum::{serve, Router};
|
||||
use tokio::net::TcpListener;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let app = Router::new()
|
||||
.route("/", get(hello));
|
||||
let listener = TcpListener::bind("0.0.0.0:80").await?;
|
||||
Ok(serve(listener, app).await?)
|
||||
}
|
||||
|
||||
async fn hello() -> &'static str {
|
||||
"Hello World"
|
||||
}
|
||||
Reference in New Issue
Block a user