Update ApiV1Controller, add instance method

This commit is contained in:
Daniel Supernault 2019-09-20 21:22:01 -06:00
parent 18bc9c3024
commit 951b6fa094
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 22 additions and 0 deletions

View File

@ -77,4 +77,26 @@ class ApiV1Controller extends Controller
return response()->json($res);
}
public function instance(Request $request)
{
$res = [
'description' => 'Pixelfed - Photo sharing for everyone',
'email' => config('instance.email'),
'languages' => ['en'],
'max_toot_chars' => config('pixelfed.max_caption_length'),
'registrations' => config('pixelfed.open_registration'),
'stats' => [
'user_count' => 0,
'status_count' => 0,
'domain_count' => 0
],
'thumbnail' => config('app.url') . '/img/pixelfed-icon-color.svg',
'title' => 'Pixelfed (' . config('pixelfed.domain.app') . ')',
'uri' => config('app.url'),
'urls' => [],
'version' => '2.7.2 (compatible; Pixelfed ' . config('pixelfed.version') . ')'
];
return response()->json($res, 200, [], JSON_PRETTY_PRINT);
}
}