api: Added 404 fallback for bad / invalid calls (#7952)

This commit is contained in:
Neil Lathwood
2018-01-06 23:34:00 +00:00
committed by GitHub
parent 364b5749ef
commit e2f122aac8

View File

@@ -33,6 +33,10 @@ if (Config::get('api.cors.enabled') === true) {
require $config['install_dir'] . '/html/includes/api_functions.inc.php';
$app->setName('api');
$app->notFound(function () use ($app) {
api_error(404, "This API route doesn't exist.");
});
$app->group(
'/api',
function () use ($app) {