From e1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 6 Dec 2024 20:43:26 +0000 Subject: initial commit hardcoded functionality mostly! --- routes/nodeinfo.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 routes/nodeinfo.php (limited to 'routes/nodeinfo.php') diff --git a/routes/nodeinfo.php b/routes/nodeinfo.php new file mode 100644 index 0000000..b507849 --- /dev/null +++ b/routes/nodeinfo.php @@ -0,0 +1,42 @@ +mount('/.well-known/nodeinfo', function (array $args) { + json_response([ + 'links' => [ + [ + 'rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.1', + 'href' => path_to_uri('/nodeinfo/2.1') + ] + ] + ], 'application/jrd+json'); +}); + +Router::getInstance()->mount('/nodeinfo/2.1', function (array $args) { + json_response([ + 'version' => '2.1', + 'software' => [ + 'name' => 'WPF test server', + 'version' => '0.1.0' + ], + 'protocols' => ['wpf'], + 'services' => [ + 'inbound' => [], + 'outbound' => [] + ], + 'openRegistrations' => false, + 'usage' => [ + 'users' => [ + 'total' => 1 + ] + ], + 'metadata' => [ + 'nodeName' => "winter's pawsome test server", + 'nodeDescription' => 'written in php i dunno', + 'wpfExtensions' => [ + // + ] + ] + ], 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.1#"'); +}); \ No newline at end of file -- cgit v1.3