diff --git a/src/App/src/Handler/HomePageHandler.php b/src/App/src/Handler/HomePageHandler.php index 980adc5..5744ad6 100644 --- a/src/App/src/Handler/HomePageHandler.php +++ b/src/App/src/Handler/HomePageHandler.php @@ -38,13 +38,6 @@ public function __construct( public function handle(ServerRequestInterface $request) : ResponseInterface { - if ($this->template === null) { - return new JsonResponse([ - 'welcome' => 'Congratulations! You have installed the zend-expressive skeleton application.', - 'docsUrl' => 'https://docs.zendframework.com/zend-expressive/', - ]); - } - $data = []; switch ($this->containerName) { @@ -86,6 +79,15 @@ public function handle(ServerRequestInterface $request) : ResponseInterface $data['routerDocs'] = 'https://docs.zendframework.com/zend-router/'; } + if ($this->template === null) { + $data = [ + 'welcome' => 'Congratulations! You have installed the zend-expressive skeleton application.', + 'docsUrl' => 'https://docs.zendframework.com/zend-expressive/', + ] + $data; + + return new JsonResponse($data, 200, [], JSON_PRETTY_PRINT); + } + if ($this->template instanceof PlatesRenderer) { $data['templateName'] = 'Plates'; $data['templateDocs'] = 'http://platesphp.com/';