2022-04-02 20:56:51 +02:00
|
|
|
use axum::{response::IntoResponse, routing::get, Json, Router};
|
|
|
|
use serde_json::json;
|
|
|
|
|
2022-04-02 21:00:38 +02:00
|
|
|
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))
|
|
|
|
}
|
|
|
|
|
2022-04-02 21:00:38 +02:00
|
|
|
async fn get_matrix_server() -> impl IntoResponse
|
|
|
|
{
|
2022-04-02 20:56:51 +02:00
|
|
|
Json(json!({"m.server": "matrix.rustybever.be:443"}))
|
|
|
|
}
|
|
|
|
|
2022-04-02 21:00:38 +02:00
|
|
|
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"}}))
|
|
|
|
}
|