mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Added an explanation for folks trying to access the API base endpoint with no real endpoint
This commit is contained in:
parent
82d8b2ab82
commit
81bf41a091
|
@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue