parent
2da7033ece
commit
091df60af4
|
@ -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))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user