{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/51","labels_url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/51/comments","events_url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/51/events","html_url":"https://github.com/strongloop/loopback-explorer/issues/51","id":44286209,"number":51,"title":"Config options - disable UI, disable Swagger","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback-explorer/labels/%23fib-2","name":"#fib-2","color":"006b75"},{"url":"https://api.github.com/repos/strongloop/loopback-explorer/labels/Beginner%20Friendly","name":"Beginner Friendly","color":"00DD00"},{"url":"https://api.github.com/repos/strongloop/loopback-explorer/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-09-29T12:10:26Z","updated_at":"2015-03-02T09:13:54Z","closed_at":null,"body":"There should be an easy way how to disable explorer (either UI only or everything) when running in production.\r\n\r\nA possible solution: add two new properties to the option object used by middleware factory function.\r\n\r\nThese two new properties then can be configured either from `server/boot/explorer.js`, or using the upcoming component infrastructure (see https://github.com/strongloop/loopback-example-component/wiki).\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/comments/76679104","html_url":"https://github.com/strongloop/loopback-explorer/issues/51#issuecomment-76679104","issue_url":"https://api.github.com/repos/strongloop/loopback-explorer/issues/51","id":76679104,"user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T09:13:54Z","updated_at":"2015-03-02T09:13:54Z","body":"On the second thought, I don't think it makes sense to disable the UI while keeping the Swagger metadata available. With metadata available, one can run an own copy of the Swagger UI (e.g. via  http://petstore.swagger.io/) and configure it with the Swagger metadata provided by the LoopBack server. \r\n\r\nSee also https://github.com/strongloop/loopback/issues/1134, it points out a similar problem.\r\n\r\nHere is the solution I would like to see implemented instead: extend loopback-boot's support for `component-config.json` (see https://github.com/strongloop/loopback-boot/pull/86) to allow developers to enable/disable components on per-environment basis.\r\n\r\nAt the moment, explorer can be configured as follows:\r\n\r\n```js\r\n// server/component-config.json\r\n{\r\n  \"loopback-explorer\": {\r\n    // config\r\n  }\r\n}\r\n```\r\n\r\nWe need to extend loopback-boot so that a component like loopback-explorer can be disabled in production via the following JSON file:\r\n\r\n```js\r\n// server/component-config.production.json\r\n{\r\n  \"loopback-explorer\": null\r\n}\r\n```\r\n\r\n@raymondfeng Thoughts? This is similar to (but not the same as) the way how middleware can be disabled on per-environment basis via `server/middleware.production.json`. I am also aware that this feature is useful for 2.x only, as https://github.com/strongloop/loopback-boot/issues/93 will obsolete it.\r\n\r\n/cc @PradnyaBaviskar "}}