Repository navigation
Resolve ${var} values in middleware.json - #149
Conversation
|
Hi @hacksparrow, thank you for the pull request. Here are my responses to your comments in #75
Not yet, all code must run on Node v0.10, which does not support ES2016 features.
loopback-boot allows users to mount the same middleware at multiple paths, this is convenient for example when configuring the same authorization middleware for multiple endpoints. That's way it's technically possible to configure As for loopback-explorer, it does not use the mechanism for middleware registration, thus it provides it's own configuration option Is it more clear now? |
|
All clear, @bajtos. Thanks! |
|
Now regarding the pull request: I would strongly prefer to support Lines 596 to 607 in 674a8da Nice to have: optimise the implementation so that it either does not use lodash's cloneDeep, or at least loads only cloneDeep, not the whole lodash module. This is important because executor runs in the browser and the lodash module adds too much code to the browserified bundle. Also please add a unit test to verify the implementation and prevent regressions in the future, see loopback-boot/test/compiler.test.js Lines 2139 to 2209 in 674a8da |
|
Some points for tomorrow's discussion based on the feedback:
|
|
@hacksparrow I can see you added new commits, please let me know when the patch is finished and ready for the next round of review. |
|
@bajtos not done with it yet. Need to add tests too. Will ping you once ready. |
|
@bajtos you can review now. |
|
@bajtos let's do the lodash thing after loopback-explorer is also loaded declaratively. |
There was a problem hiding this comment.
Please simplify:
updatedConfigObject[configKey] = value.map(getConfigVariable);|
Reviewed. The code looks mostly good, I left few minor comments to address. Please re-run |
|
Thanks for the feedback @bajtos. Will make the changes accordingly. |
|
@bajtos, pushed the recommended changes. |
|
The patch LGTM 👍 @hacksparrow Could you please squash the commits into a single one and provide a descriptive commit message following the 50/72 rule? |
0cfa620 to
09139ee
Compare
App variables can now be specified in middleware.json using the ${var}
format. The value of var is looked up using app.get().
This allows loopback.rest and other loopback middleware which require
app variables, to be loaded declaratively using middleware.json.
09139ee to
8b475a9
Compare
…-rest
Resolve ${var} values in middleware.json
|
Landed, thank you! |
|
🎉 |
|
@hacksparrow Great stuff! |
|
+1 |
Declaratively load loopback.rest using
middleware.json:Connect to #75