feature(shuttle): adapt shuttle implementation to new server structure

This commit is contained in:
Patryk Hegenberg 2024-05-02 11:10:27 +02:00
parent cf0f140ba3
commit 5b69d5bfbe

View file

@ -4,7 +4,7 @@ use crate::relay::server::download_success;
use crate::relay::server::upload_info; use crate::relay::server::upload_info;
use crate::relay::server::ws_handler; use crate::relay::server::ws_handler;
use axum::{ use axum::{
routing::{get, post}, routing::{get, post, put},
Router, Router,
}; };
use axum_client_ip::SecureClientIpSource; use axum_client_ip::SecureClientIpSource;
@ -23,7 +23,7 @@ async fn axum() -> ShuttleAxum {
// Set up the application routes. // Set up the application routes.
let app = Router::new() let app = Router::new()
.route("/ws", get(ws_handler)) .route("/ws", get(ws_handler))
.route("/upload", post(upload_info)) .route("/upload", put(upload_info))
.route("/download/:name", get(download_info)) .route("/download/:name", get(download_info))
.route("/download_success/:name", post(download_success)) .route("/download_success/:name", post(download_success))
.with_state(appstate) .with_state(appstate)