From 466fb5e8c8e0bd48bf4eea7e50d4e0a8ea4c94a0 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 4 Apr 2023 00:12:14 -0300 Subject: [PATCH] add axum --- .gitignore | 5 +++++ Cargo.toml | 10 ++++++++++ src/main.rs | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore index 3ca43ae..193d30e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,8 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b08d54b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "glimbus" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +axum = { version = "0.6.12", features = ["tokio"] } +tokio = { version = "1.27.0", features = ["full"] } diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..472dd26 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,13 @@ +use axum::{routing::get, Router}; + +#[tokio::main] +async fn main() { + // build our application with a single route + let app = Router::new().route("/", get(|| async { "Hello, World!" })); + + // run it with hyper on localhost:3000 + axum::Server::bind(&"0.0.0.0:6679".parse().unwrap()) + .serve(app.into_make_service()) + .await + .unwrap(); +}