Added an explanation for folks trying to access the API base endpoint with no real endpoint

This commit is contained in:
snipe 2020-12-08 21:05:01 -08:00
parent 82d8b2ab82
commit 81bf41a091

View file

@ -16,6 +16,20 @@ use Illuminate\Http\Request;
Route::group(['prefix' => 'v1','namespace' => 'Api', 'middleware' => 'auth:api'], function () {
Route::get('/', function() {
return response()->json(
[
'status' => 'error',
'message' => '404 endpoint not found. This is the base URL for the API and does not return anything itself. Please check the API reference at https://snipe-it.readme.io/reference to find a valid API endpoint.',
'payload' => null,
], 404);
});
Route::group(['prefix' => 'account'], function () {
Route::get('requestable/hardware',
@ -990,6 +1004,15 @@ Route::group(['prefix' => 'v1','namespace' => 'Api', 'middleware' => 'auth:api']
}); // kits group
Route::fallback(function(){
return response()->json(
[
'status' => 'error',
'message' => '404 endpoint not found. Please check the API reference at https://snipe-it.readme.io/reference to find a valid API endpoint.',
'payload' => null,
], 404);
});
});