]> BookStack Code Mirror - bookstack/blobdiff - app/Api/ApiDocsController.php
respective book and chapter structure added.
[bookstack] / app / Api / ApiDocsController.php
index d6acf05f2b770c6ead22ff0eacaefd02673c6fd6..d88dba3bc2f8100de18436548e16e0bf07831dd1 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace BookStack\Api;
 
-use BookStack\Http\Controllers\ApiController;
+use BookStack\Http\ApiController;
 
 class ApiDocsController extends ApiController
 {
@@ -28,4 +28,14 @@ class ApiDocsController extends ApiController
 
         return response()->json($docs);
     }
+
+    /**
+     * Redirect to the API docs page.
+     *  Required as a controller method, instead of the Route::redirect helper,
+     *  to ensure the URL is generated correctly.
+     */
+    public function redirect()
+    {
+        return redirect('/api/docs');
+    }
 }