aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/nodeinfo.php
diff options
context:
space:
mode:
authorwinter2024-12-06 20:43:26 +0000
committerwinter2024-12-06 20:43:26 +0000
commite1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 (patch)
tree4ef08af2b4051d433bb929d5162474ac6777cab1 /routes/nodeinfo.php
initial commit
hardcoded functionality mostly!
Diffstat (limited to 'routes/nodeinfo.php')
-rw-r--r--routes/nodeinfo.php42
1 files changed, 42 insertions, 0 deletions
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 @@
+<?php
+
+use WpfTest\Router;
+
+Router::getInstance()->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