1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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#"');
});
|