1
0
Fork 0

Add route "GET /.well-known/matrix/server"

This commit is contained in:
Alex Kotov 2020-10-23 08:08:44 +05:00
parent a263fe85d6
commit 3d76923802
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ mod reports;
mod sessions;
mod team;
mod users;
mod well_known;
pub fn routes() -> Vec<rocket::Route> {
routes![
@ -16,5 +17,6 @@ pub fn routes() -> Vec<rocket::Route> {
team::index,
users::new,
users::create,
well_known::matrix::server::show,
]
}

1
src/routes/well_known.rs Normal file
View File

@ -0,0 +1 @@
pub mod matrix;

View File

@ -0,0 +1 @@
pub mod server;

View File

@ -0,0 +1,10 @@
use rocket::http::ContentType;
use rocket::response::content::Content;
#[get("/.well-known/matrix/server")]
pub fn show() -> Content<String> {
Content(
ContentType::JSON,
"{ \"m.server\": \"matrix.fedihub.com\" }".to_string(),
)
}