mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Added /api => /api/docs redirect for convenience.
This commit is contained in:
parent
7025cb38df
commit
2051189921
@ -42,6 +42,7 @@ Route::middleware('auth')->group(function () {
|
||||
->where('path', '.*$');
|
||||
|
||||
// API docs routes
|
||||
Route::redirect('/api', '/api/docs');
|
||||
Route::get('/api/docs', [Api\ApiDocsController::class, 'display']);
|
||||
|
||||
Route::get('/pages/recently-updated', [PageController::class, 'showRecentlyUpdated']);
|
||||
|
@ -10,6 +10,12 @@ class ApiDocsTest extends TestCase
|
||||
|
||||
protected $endpoint = '/api/docs';
|
||||
|
||||
public function test_api_endpoint_redirects_to_docs()
|
||||
{
|
||||
$resp = $this->actingAsApiEditor()->get('/api');
|
||||
$resp->assertRedirect('api/docs');
|
||||
}
|
||||
|
||||
public function test_docs_page_returns_view_with_docs_content()
|
||||
{
|
||||
$resp = $this->actingAsApiEditor()->get($this->endpoint);
|
||||
|
Loading…
Reference in New Issue
Block a user