Skip to content

Commit

Permalink
feat(chat): adds simple http server
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Sep 2, 2023
1 parent 38011c5 commit a224272
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions services/chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
axum = "0.6.20"
handlebars = "4.4.0"
tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] }
12 changes: 10 additions & 2 deletions services/chat/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
fn main() {
println!("Hello, world!");
use axum::{routing::get, Router};

#[tokio::main]
async fn main() {
let app = Router::new().route("/", get(|| async { "Hello, World!" }));

axum::Server::bind(&"0.0.0.0:4002".parse().unwrap())
.serve(app.into_make_service())
.await
.unwrap();
}

0 comments on commit a224272

Please sign in to comment.