You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Here is the solution I would like to see implemented instead: extend loopback-boot's support for component-config.json (see strongloop/loopback-boot#86) to allow developers to enable/disable components on per-environment basis.
At the moment, explorer can be configured as follows:
@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 strongloop/loopback-boot#93 will obsolete it.
No, loopback-explorer does not need to be changed, this feature will be handled by loopback-boot. That's why I am proposing loopback-explorer: null as opposed to loopback-explorer: { enabled: false }.
OK, so if loopback-explorer: null or loopback-explorer: false is configured, loopback-boot doesn't even bother to load the loopback-explorer component, right? If so, I'm +1.
BTW, we should consider to use this convention to remove/disable properties inherited from base models.
OK, so if loopback-explorer: null or loopback-explorer: false is configured, loopback-boot doesn't even bother to load the loopback-explorer component, right? If so, I'm +1.
Yes, that's the plan
BTW, we should consider to use this convention to remove/disable properties inherited from base models.
I am fine with that, thought it's completely out of scope of this issue.
Works if no overrides. If original component-config.json has any configuration options defined, then override with false fails and the app exits. Does anyone else experience the same issue?
@voitau Works if no overrides. If original component-config.json has any configuration options defined, then override with false fails and the app exits. Does anyone else experience the same issue?
This is off-topic for this GH issue. Please open a new issue for the problem and provide steps for reproducing the issue on our machines, see wiki.
This is still an issue because setting loopback-explorer: null or loopback-explorer: false in component-config.production.json doesn't override loopback-explorer: { ... }.
Here's a test for loopback-boot to replicate the issue:
@alFReD-NSH This is still an issue because setting loopback-explorer: null or loopback-explorer: false in component-config.production.json doesn't override loopback-explorer: { ... }.
Could you please open an issue in loopback-boot? Submitting a patch fixing the issue would be even better :)
Activity
ricardohbin commentedon Nov 19, 2014
+1
oakley808 commentedon Jan 21, 2015
+1
bajtos commentedon Jan 21, 2015
@ricardohbin @oakley808 Can you contribute this feature yourself?
bajtos commentedon Mar 2, 2015
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.
See also strongloop/loopback#1134, it points out a similar problem.
Here is the solution I would like to see implemented instead: extend loopback-boot's support for
component-config.json(see strongloop/loopback-boot#86) to allow developers to enable/disable components on per-environment basis.At the moment, explorer can be configured as follows:
We need to extend loopback-boot so that a component like loopback-explorer can be disabled in production via the following JSON file:
@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 strongloop/loopback-boot#93 will obsolete it./cc @PradnyaBaviskar
raymondfeng commentedon Mar 2, 2015
@bajtos With your proposal, do we need to change the loopback-explorer code to accept the config object and decide if itself should be disabled?
bajtos commentedon Mar 2, 2015
No, loopback-explorer does not need to be changed, this feature will be handled by loopback-boot. That's why I am proposing
loopback-explorer: nullas opposed toloopback-explorer: { enabled: false }.raymondfeng commentedon Mar 2, 2015
OK, so if
loopback-explorer: nullorloopback-explorer: falseis configured,loopback-bootdoesn't even bother to load theloopback-explorercomponent, right? If so, I'm +1.BTW, we should consider to use this convention to
remove/disableproperties inherited from base models.bajtos commentedon Mar 2, 2015
Yes, that's the plan
I am fine with that, thought it's completely out of scope of this issue.
ricardohbin commentedon Mar 2, 2015
surely @bajtos, I can give a look at this ;)
bajtos commentedon Mar 10, 2015
The loopback-boot change has been landed via strongloop/loopback-boot#103, let me know if it works for you.
voitau commentedon Oct 25, 2015
Tried to use as suggested in documentation:
Works if no overrides. If original
component-config.jsonhas any configuration options defined, then override withfalsefails and the app exits. Does anyone else experience the same issue?bajtos commentedon Nov 6, 2015
This is off-topic for this GH issue. Please open a new issue for the problem and provide steps for reproducing the issue on our machines, see wiki.
faridnsh commentedon Dec 28, 2015
This is still an issue because setting
loopback-explorer: nullorloopback-explorer: falsein component-config.production.json doesn't overrideloopback-explorer: { ... }.Here's a test for loopback-boot to replicate the issue:
bajtos commentedon Jan 7, 2016
Could you please open an issue in loopback-boot? Submitting a patch fixing the issue would be even better :)
faridnsh commentedon Jan 8, 2016
There's already in an issue opened there: strongloop/loopback-boot#146
I'll be submitting a pr soon.
When config is overriden with null don't merge