Skip to content

Commit

Permalink
feat: add fallback route
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahTeoh committed Jun 26, 2024
1 parent a209529 commit 6955266
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@

Route::get('get_all_records', [KeyValueController::class, 'index']);
Route::get('object/{key}', [KeyValueController::class, 'show']);
Route::post('object', [KeyValueController::class, 'store']);
Route::post('object', [KeyValueController::class, 'store']);

Route::fallback(function () {
return response()->json([
'message' => 'Endpoint Not Found. If error persists, contact admin'], 404);
});

0 comments on commit 6955266

Please sign in to comment.