Using a simple version string.

This commit is contained in:
Dessalines 2023-10-19 11:56:05 -04:00
parent bea1408b65
commit b44529bdfa
2 changed files with 7 additions and 3 deletions

View file

@ -12,10 +12,11 @@ use serde::{Deserialize, Serialize};
use url::Url;
pub fn config(cfg: &mut web::ServiceConfig) {
let nodeinfo_json_route = || web::get().to(node_info).wrap(cache_1hour());
cfg
.route("/nodeinfo/2.0.json", nodeinfo_json_route())
.route("/version", nodeinfo_json_route())
.route(
"/nodeinfo/2.0.json",
web::get().to(node_info).wrap(cache_1hour()),
)
.route(
"/.well-known/nodeinfo",
web::get().to(node_info_well_known).wrap(cache_3days()),

View file

@ -1,4 +1,5 @@
pub mod api_routes_http;
use actix_web::web;
pub mod code_migrations;
#[cfg(feature = "prometheus-metrics")]
pub mod prometheus_metrics;
@ -51,6 +52,7 @@ use lemmy_utils::{
rate_limit::RateLimitCell,
response::jsonify_plain_text_errors,
settings::{structs::Settings, SETTINGS},
version,
};
use reqwest::Client;
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
@ -334,6 +336,7 @@ fn create_http_server(
// The routes
app
.route("/version", web::get().to(|| async { version::VERSION }))
.configure(|cfg| api_routes_http::config(cfg, &rate_limit_cell))
.configure(|cfg| {
if federation_enabled {