serve well-known client and server config

This way users can have a simpler time configuring this stuff and we can
worry about the spec compliance parts and specifying the same thing over
and over parts.
This commit is contained in:
Charles Hall 2024-09-05 10:47:02 -07:00
parent 3a55684623
commit 806cc0cb28
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 99 additions and 1 deletions

View file

@ -50,7 +50,7 @@ mod service;
mod utils;
pub(crate) use api::ruma_wrapper::{Ar, Ra};
use api::{client_server, server_server};
use api::{client_server, server_server, well_known};
pub(crate) use config::{Config, ListenConfig};
pub(crate) use database::KeyValueDatabase;
pub(crate) use service::{pdu::PduEvent, Services};
@ -491,6 +491,10 @@ fn routes(config: &Config) -> Router {
.route("/", get(it_works))
.fallback(not_found);
let router = router
.route("/.well-known/matrix/client", get(well_known::client))
.route("/.well-known/matrix/server", get(well_known::server));
if config.federation.enable {
router
.ruma_route(s2s::get_server_version_route)