Adding /version route. Fixes #2914

This commit is contained in:
Dessalines 2023-10-18 16:34:56 -04:00
parent a675fecacd
commit bea1408b65
2 changed files with 4 additions and 5 deletions

View file

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

View file

@ -56,7 +56,7 @@ http {
} }
# backend # backend
location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) { location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known|version) {
proxy_pass "http://lemmy"; proxy_pass "http://lemmy";
# proxy common stuff # proxy common stuff
proxy_http_version 1.1; proxy_http_version 1.1;