diff --git a/api.php b/api.php index b29f12f..d18a5a8 100644 --- a/api.php +++ b/api.php @@ -1,5 +1,6 @@ pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters')); $api->pipe($app->make('Flarum\Api\Middleware\LoginWithHeader')); $api->pipe('/api', $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.api.routes')])); -$api->pipe(new \Flarum\Api\Middleware\JsonApiErrors()); + +if (Core::inDebugMode()) { + $api->pipe(new \Franzl\Middleware\Whoops\Middleware()); +} else { + $api->pipe(new \Flarum\Api\Middleware\JsonApiErrors()); +} $server = Server::createServer( $api,