Replaces actix with axum for web, allows us to use socket.io and gives us access to the tower ecosystem of middleware breaks compatibility with our current websocket implementation, needs to be reimplemented for socket.io
24 lines
525 B
Rust
24 lines
525 B
Rust
use std::sync::Arc;
|
|
|
|
use axum::{
|
|
Router,
|
|
routing::{delete, get, patch},
|
|
};
|
|
//use socketioxide::SocketIo;
|
|
|
|
use crate::AppState;
|
|
|
|
mod uuid;
|
|
|
|
pub fn router() -> Router<Arc<AppState>> {
|
|
//let (layer, io) = SocketIo::new_layer();
|
|
|
|
//io.ns("/{uuid}/socket", uuid::socket::ws);
|
|
|
|
Router::new()
|
|
.route("/{uuid}", get(uuid::get))
|
|
.route("/{uuid}", delete(uuid::delete))
|
|
.route("/{uuid}", patch(uuid::patch))
|
|
.route("/{uuid}/messages", get(uuid::messages::get))
|
|
//.layer(layer)
|
|
}
|