Skip to content

Commit

Permalink
bump axum
Browse files Browse the repository at this point in the history
  • Loading branch information
“Giems” committed Feb 1, 2024
1 parent 80f5d9c commit e95445d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ uuid7 = { version = "0.7.2" }
log = "0.4.20"

futures = "0.3.30"
axum = { version = "0.6.12", features = ["ws", "macros"] }
tower = { version = "0.4", features = [
axum = { version = "0.7.4", features = ["ws", "macros"] }
tower = { version = "0.4.13", features = [
"util",
"timeout",
"load-shed",
"limit",
] }
tower-http = { version = "0.4.3", features = ["cors", "trace"] }
hyper = { version = "0.14.14", features = ["stream"] }
tower-http = { version = "0.5.1", features = ["cors", "trace"] }
reqwest = "0.11.24"
tokio = { version = "1.26.0", features = ["full"] }
tokio = { version = "1.35.1", features = ["full"] }
async-trait = "0.1.77"
13 changes: 9 additions & 4 deletions server/src/bin/nightly-connect-server.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
use server::router::get_router;
use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::mpsc::channel;

#[tokio::main]
async fn main() {
dotenvy::dotenv().expect(".env file not found");

let router = get_router().await;
let socket = SocketAddr::from_str("127.0.0.1:6969").unwrap();
let listener = tokio::net::TcpListener::bind(&"127.0.0.1:6969")
.await
.expect("Failed to bind socket");

let server = axum::Server::bind(&socket).serve(
let server = axum::serve(
listener,
router
.clone()
.into_make_service_with_connect_info::<SocketAddr>(),
);
tokio::spawn(server);

tokio::spawn(async move {
server.await.unwrap();
});

let (tx, rx) = channel();
ctrlc::set_handler(move || tx.send(()).expect("Could not send signal on channel."))
Expand Down

0 comments on commit e95445d

Please sign in to comment.