{"action":"opened","issue":{"url":"https://api.github.com/repos/zendframework/zend-expressive/issues/412","repository_url":"https://api.github.com/repos/zendframework/zend-expressive","labels_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/412/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/412/comments","events_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/412/events","html_url":"https://github.com/zendframework/zend-expressive/issues/412","id":195880499,"number":412,"title":"Development mode","user":{"login":"danizord","id":1850941,"avatar_url":"https://avatars.githubusercontent.com/u/1850941?v=3","gravatar_id":"","url":"https://api.github.com/users/danizord","html_url":"https://github.com/danizord","followers_url":"https://api.github.com/users/danizord/followers","following_url":"https://api.github.com/users/danizord/following{/other_user}","gists_url":"https://api.github.com/users/danizord/gists{/gist_id}","starred_url":"https://api.github.com/users/danizord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danizord/subscriptions","organizations_url":"https://api.github.com/users/danizord/orgs","repos_url":"https://api.github.com/users/danizord/repos","events_url":"https://api.github.com/users/danizord/events{/privacy}","received_events_url":"https://api.github.com/users/danizord/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T18:32:27Z","updated_at":"2016-12-15T18:32:27Z","closed_at":null,"body":"Our app has some middlewares that are specific to the development environment.\r\n\r\nIn the past, with config-based pipeline we managed to pipe these middlewares only in development enviroment by placing their config in `local.php` file. But now with the programmatic pipeline approach I'm not sure what's the best way to pipe a middleware or route depending on the environment.\r\n\r\nI think we could add an `isDevelopmentMode()` method to the `Application` class that returns the value of `debug` flag from config, so that we could pipe development middlewares like that:\r\n\r\n```php\r\n$app->pipe(ErrorHandler::class);\r\n\r\nif ($app->isDevelopmentMode()) {\r\n    $app->pipe(MyDevelopmentMiddleware::class);\r\n}\r\n\r\n$app->pipeRoutingMiddleware();\r\n//...\r\n```\r\n\r\nThoughts?"}}
{"actor":{"display_login":"danizord"}}