update to axum 0.7

This commit is contained in:
Paul Zinselmeyer 2023-12-08 13:29:53 +01:00
parent defa769dd2
commit b92eef2e00
Signed by: pfzetto
GPG key ID: 4EEF46A5B276E648
4 changed files with 385 additions and 206 deletions

549
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,15 +13,15 @@ thiserror = "1.0.50"
tokio = { version = "1.33", features = ["full"] }
tokio-util = "0.7"
futures-util = "0.3"
axum = { version = "0.6", features = ["multipart"] }
axum-oidc = "0.1.0"
axum-htmx = "0.4"
tower-http = { version= "0.4", features = ["fs"] }
axum = { version = "0.7", features = ["multipart"] }
axum-oidc = "0.2"
axum-htmx = "0.5"
sailfish = "0.8"
serde = "1.0"
toml = "0.8"
rand = "0.8"
qrcode = "0.12"
tower = "0.4.13"
tower-sessions = "0.4.1"
tower-sessions = "0.7"
tower-http = { version= "0.5", features = ["fs"] }
prometheus-client = "0.22.0"

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1699548976,
"narHash": "sha256-xnpxms0koM8mQpxIup9JnT0F7GrKdvv0QvtxvRuOYR4=",
"lastModified": 1701622587,
"narHash": "sha256-o3XhxCCyrUHZ0tlta2W7/MuXzy+n0+BUt3rKFK3DIK4=",
"owner": "ipetkov",
"repo": "crane",
"rev": "6849911446e18e520970cc6b7a691e64ee90d649",
"rev": "c09d2cbe84cc2adfe1943cb2a0b55a71c835ca9a",
"type": "github"
},
"original": {
@ -25,11 +25,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
@ -40,11 +40,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1699099776,
"narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=",
"lastModified": 1701718080,
"narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb",
"rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335",
"type": "github"
},
"original": {
@ -72,11 +72,11 @@
]
},
"locked": {
"lastModified": 1699582387,
"narHash": "sha256-sPmUXPDl+cEi+zFtM5lnAs7dWOdRn0ptZ4a/qHwvNDk=",
"lastModified": 1702001829,
"narHash": "sha256-6gEVidNVqzTb06zIy2Gxhz9m6/jXyAgViRxfgEpZkQ8=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "41f7b0618052430d3a050e8f937030d00a2fcced",
"rev": "c2a1dd067a928624c1aab36f976758c0722c79bd",
"type": "github"
},
"original": {

View file

@ -30,7 +30,7 @@ use question::{single_choice::SingleChoiceQuestion, Question};
use sailfish::TemplateOnce;
use serde::{Deserialize, Serialize};
use stream::{PlayerBroadcastStream, ViewerBroadcastStream};
use tokio::{sync::RwLock, task::spawn_blocking};
use tokio::{net::TcpListener, sync::RwLock, task::spawn_blocking};
use tower::ServiceBuilder;
use tower_http::services::ServeDir;
use tower_sessions::{cookie::SameSite, MemoryStore, SessionManagerLayer};
@ -143,8 +143,10 @@ pub async fn main() {
.layer(oidc_auth_service)
.layer(session_service);
axum::Server::bind(&"[::]:8080".parse().expect("valid listen address"))
.serve(app.into_make_service())
let listener = TcpListener::bind("[::]:8080")
.await
.expect("valid listen address");
axum::serve(listener, app.into_make_service())
.await
.expect("axum server");
}