diff options
Diffstat (limited to 'src/Controllers/Server/ServerInformationController.php')
| -rw-r--r-- | src/Controllers/Server/ServerInformationController.php | 30 |
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", + ], + ]); + } +} |
