3 namespace BookStack\Api;
5 use BookStack\Http\ApiController;
7 class ApiDocsController extends ApiController
10 * Load the docs page for the API.
12 public function display()
14 $docs = ApiDocsGenerator::generateConsideringCache();
15 $this->setPageTitle(trans('settings.users_api_tokens_docs'));
17 return view('api-docs.index', [
23 * Show a JSON view of the API docs data.
25 public function json()
27 $docs = ApiDocsGenerator::generateConsideringCache();
29 return response()->json($docs);
33 * Redirect to the API docs page.
34 * Required as a controller method, instead of the Route::redirect helper,
35 * to ensure the URL is generated correctly.
37 public function redirect()
39 return redirect('/api/docs');