summaryrefslogtreecommitdiff
path: root/src/Controllers/Server/ServerInformationController.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2026-04-10 13:37:26 +0200
committerDaniel Weipert <git@mail.dweipert.de>2026-04-10 13:41:14 +0200
commit99006cd6370f0502693f3fa9e3c20c83c02b364f (patch)
tree911c34cd93444f37f4781208020853bae9c42b7a /src/Controllers/Server/ServerInformationController.php
parent6929089fea7cf79ae5ca9e05486ba33b0e5b216d (diff)
switch routing to attributes
Diffstat (limited to 'src/Controllers/Server/ServerInformationController.php')
-rw-r--r--src/Controllers/Server/ServerInformationController.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Controllers/Server/ServerInformationController.php b/src/Controllers/Server/ServerInformationController.php
new file mode 100644
index 0000000..a77bcca
--- /dev/null
+++ b/src/Controllers/Server/ServerInformationController.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Controllers\Server;
+
+use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Attribute\Route;
+
+class ServerInformationController
+{
+ #[Route(path: "/.well-known/matrix/server", methods: ["GET"])]
+ public function server(Request $request): Response
+ {
+ return new JsonResponse([
+ "m.server" => "$_ENV[DOMAIN]:443",
+ ]);
+ }
+
+ #[Route(path: "/_matrix/federation/v1/version", methods: ["GET"])]
+ public function version(Request $request): Response
+ {
+ return new JsonResponse([
+ "server" => [
+ "name" => "Matrix PHP",
+ "version" => "0.1.0",
+ ],
+ ]);
+ }
+}