move sitemap to top level, not in api

This commit is contained in:
Felix Ableitner 2024-12-18 11:11:31 +01:00
parent 55b8aced9d
commit 460ccc8e5a
3 changed files with 7 additions and 9 deletions

View file

@ -87,7 +87,6 @@ use lemmy_api::{
unread_count::get_unread_registration_application_count,
},
},
sitemap::get_sitemap,
};
use lemmy_api_crud::{
comment::{
@ -395,9 +394,4 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
.route("/delete", post().to(delete_custom_emoji)),
),
);
cfg.service(
scope("/sitemap.xml")
.wrap(rate_limit.message())
.route("", get().to(get_sitemap)),
);
}

View file

@ -96,7 +96,6 @@ use lemmy_api::{
unread_count::get_unread_registration_application_count,
},
},
sitemap::get_sitemap,
};
use lemmy_api_crud::{
comment::{
@ -392,7 +391,6 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
.wrap(rate_limit.register())
.route("/authenticate", post().to(authenticate_with_oauth)),
)
.route("/sitemap.xml", get().to(get_sitemap))
.service(
scope("/image")
.service(

View file

@ -11,13 +11,14 @@ use actix_cors::Cors;
use actix_web::{
dev::{ServerHandle, ServiceResponse},
middleware::{self, Condition, ErrorHandlerResponse, ErrorHandlers},
web::Data,
web::{get, scope, Data},
App,
HttpResponse,
HttpServer,
};
use actix_web_prom::PrometheusMetricsBuilder;
use clap::Parser;
use lemmy_api::sitemap::get_sitemap;
use lemmy_api_common::{
context::LemmyContext,
lemmy_db_views::structs::SiteView,
@ -324,6 +325,11 @@ fn create_http_server(
})
.configure(feeds::config)
.configure(nodeinfo::config)
.service(
scope("/sitemap.xml")
.wrap(rate_limit_cell.message())
.route("", get().to(get_sitemap)),
)
})
.disable_signals()
.bind(bind)?