Skip to content

Commit

Permalink
feature: only wrap search and recommend routes with compression
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh authored and skeptrunedev committed Jul 23, 2024
1 parent 24e3d5b commit 0bf5ffe
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use actix_identity::IdentityMiddleware;
use actix_session::{config::PersistentSession, storage::RedisSessionStore, SessionMiddleware};
use actix_web::{
cookie::{Key, SameSite},
middleware::Logger,
middleware::{Compress, Logger},
web::{self, PayloadConfig},
App, HttpServer,
};
Expand Down Expand Up @@ -785,13 +785,17 @@ pub fn main() -> std::io::Result<()> {
)
.service(web::resource("/recommend").route(
web::post().to(handlers::chunk_handler::get_recommended_chunks),
))
)
.wrap(Compress::default())
)
.service(
web::resource("/autocomplete")
.wrap(Compress::default())
.route(web::post().to(handlers::chunk_handler::autocomplete)),
)
.service(
web::resource("/search")
.wrap(Compress::default())
.route(web::post().to(handlers::chunk_handler::search_chunks)),
)
.service(
Expand Down Expand Up @@ -861,17 +865,21 @@ pub fn main() -> std::io::Result<()> {
))
.service(
web::resource("/search")
.route(web::post().to(handlers::group_handler::search_within_group)),
.route(web::post().to(handlers::group_handler::search_within_group))
.wrap(Compress::default())
,
)
.service(
web::resource("/group_oriented_search").route(
web::post().to(handlers::group_handler::search_over_groups),
),
)
.wrap(Compress::default())
)
.service(
web::resource("/recommend").route(
web::post().to(handlers::group_handler::get_recommended_groups),
),
) .wrap(Compress::default())
,
)
.service(
web::resource("/chunk/{chunk_group_id}")
Expand Down

0 comments on commit 0bf5ffe

Please sign in to comment.