test-ok
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
Untone 2024-10-02 18:14:54 +03:00
parent 2da7033ece
commit 091df60af4

View File

@ -4,7 +4,7 @@ mod handlers;
mod s3_utils; mod s3_utils;
mod thumbnail; mod thumbnail;
use actix_web::{middleware::Logger, web, App, HttpServer}; use actix_web::{middleware::Logger, web, App, HttpServer, HttpResponse};
use app_state::AppState; use app_state::AppState;
use handlers::{proxy_handler, upload_handler}; use handlers::{proxy_handler, upload_handler};
use tokio::task::spawn_blocking; use tokio::task::spawn_blocking;
@ -28,6 +28,7 @@ async fn main() -> std::io::Result<()> {
App::new() App::new()
.app_data(web::Data::new(app_state.clone())) .app_data(web::Data::new(app_state.clone()))
.wrap(Logger::default()) .wrap(Logger::default())
.route("/", web::get().to(|| async { HttpResponse::Ok().body("ok") }))
.route("/{path:.*}", web::get().to(proxy_handler)) .route("/{path:.*}", web::get().to(proxy_handler))
.route("/", web::post().to(upload_handler)) .route("/", web::post().to(upload_handler))
}) })