add routes

This commit is contained in:
Brandon Thomas committed 2025-06-03 09:31:42 -04:00
1 parent bfd864c082
commit 377acb3e4a
4 files changed
+42 -13

No files matched your search

@@ -1 +1 @@
mod remove_image_background_handler;
pub mod remove_image_background_handler;
@@ -0,0 +1,26 @@
use crate::http_server::endpoints::generate::image::remove_image_background_handler::remove_image_background_handler;
use actix_http::body::MessageBody;
use actix_service::ServiceFactory;
use actix_web::dev::{ServiceRequest, ServiceResponse};
use actix_web::{web, App, Error, HttpResponse};
pub fn add_generate_routes<T, B> (app: App<T>) -> App<T>
where
B: MessageBody,
T: ServiceFactory<
ServiceRequest,
Config = (),
Response = ServiceResponse<B>,
Error = Error,
InitError = (),
>,
{
app.service(web::scope("/v1/generate")
.service(web::scope("/image")
.service(web::resource("/remove_background")
.route(web::post().to(remove_image_background_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
)
)
}
@@ -124,6 +124,7 @@ use crate::http_server::endpoints::voice_designer::voices::list_voices_by_user::
use crate::http_server::endpoints::voice_designer::voices::search_voices::search_voices;
use crate::http_server::endpoints::voice_designer::voices::update_voice::update_voice_handler;
use crate::http_server::routes::add_control_plane_routes::add_control_plane_routes;
use crate::http_server::routes::add_generate_routes::add_generate_routes;
use crate::http_server::routes::add_image_studio_routes::add_image_studio_routes;
use crate::http_server::routes::add_studio_gen2_routes::add_studio_gen2_routes;
use crate::http_server::routes::beta_key_routes::add_beta_key_routes;
@@ -177,6 +178,7 @@ pub fn add_routes<T, B> (app: App<T>, server_environment: ServerEnvironment) ->
app = add_job_routes(app);
app = add_engine_routes(app); /* /v1/engine/... */
app = add_control_plane_routes(app); /* /v1/control_plane/... */
app = add_generate_routes(app); /* /v1/generate/... */
// app = add_image_gen_routes(app);
@@ -1,13 +1,14 @@
pub mod add_routes;
pub mod add_studio_gen2_routes;
pub mod beta_key_routes;
pub mod job_routes;
pub mod media_files_routes;
pub mod model_download_routes;
pub mod moderation_routes;
pub mod user_routes;
pub mod weights_routes;
pub mod workflow_routes;
mod tag_routes;
mod add_control_plane_routes;
mod add_generate_routes;
mod add_image_studio_routes;
mod add_control_plane_routes;
mod add_studio_gen2_routes;
mod beta_key_routes;
mod job_routes;
mod media_files_routes;
mod model_download_routes;
mod moderation_routes;
mod tag_routes;
mod user_routes;
mod weights_routes;
mod workflow_routes;
pub mod add_routes;