refactor: rewrite entire codebase in axum instead of actix

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
This commit is contained in:
Radical 2025-07-16 16:36:22 +02:00
parent 3647086adb
commit 324137ce8b
47 changed files with 1381 additions and 1129 deletions

View file

@ -1,12 +1,24 @@
use actix_web::{Scope, web};
use std::sync::Arc;
use axum::{
Router,
routing::{delete, get, patch},
};
//use socketioxide::SocketIo;
use crate::AppState;
mod uuid;
pub fn web() -> Scope {
web::scope("/channels")
.service(uuid::get)
.service(uuid::delete)
.service(uuid::patch)
.service(uuid::messages::get)
.service(uuid::socket::ws)
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)
}