site-backend/src/matrix.rs

17 lines
521 B
Rust
Raw Normal View History

2022-04-02 20:56:51 +02:00
use axum::{response::IntoResponse, routing::get, Json, Router};
use serde_json::json;
pub fn router() -> Router {
2022-04-02 20:56:51 +02:00
Router::new()
.route("/.well-known/matrix/server", get(get_matrix_server))
.route("/.well-known/matrix/client", get(get_matrix_client))
}
async fn get_matrix_server() -> impl IntoResponse {
2022-04-02 20:56:51 +02:00
Json(json!({"m.server": "matrix.rustybever.be:443"}))
}
async fn get_matrix_client() -> impl IntoResponse {
2022-04-02 20:56:51 +02:00
Json(json!({"m.homeserver": {"base_url": "https://matrix.rustybever.be"}}))
}