mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Remove axum::prelude (#195)
This commit is contained in:
+8
-3
@@ -14,9 +14,14 @@ use futures::{sink::SinkExt, stream::StreamExt};
|
||||
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
use axum::extract::ws::{Message, WebSocket, WebSocketUpgrade};
|
||||
use axum::prelude::*;
|
||||
use axum::extract::{
|
||||
ws::{Message, WebSocket, WebSocketUpgrade},
|
||||
Extension,
|
||||
};
|
||||
use axum::handler::get;
|
||||
use axum::response::{Html, IntoResponse};
|
||||
use axum::route;
|
||||
use axum::routing::RoutingDsl;
|
||||
use axum::AddExtensionLayer;
|
||||
|
||||
// Our shared state
|
||||
@@ -46,7 +51,7 @@ async fn main() {
|
||||
|
||||
async fn websocket_handler(
|
||||
ws: WebSocketUpgrade,
|
||||
extract::Extension(state): extract::Extension<Arc<AppState>>,
|
||||
Extension(state): Extension<Arc<AppState>>,
|
||||
) -> impl IntoResponse {
|
||||
ws.on_upgrade(|socket| websocket(socket, state))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user