Variables cannot be concatenated with rest string in middleware.json
Defining middleware documented how to use variables in file middleware.json. It works if the variable takes entire string value, but not if the value contains other string. For example, if clientRoot = /ext, then following static config resolves /ext by "${clientRoot}", but /ext/foo cannot be resolved by "${clientRoot}/?*". If I replace "${clientRoot}/?*" with hard-coded "/ext/?*" then it works.
"files": {
"loopback#static": [
{
"paths": [
"${clientRoot}",
"/"
],
"params": "$!../client/dist"
},
{
"paths": [
"${clientRoot}/?*"
],
"params": "$!../client/dist"
}
]
},
We currently replace the whole variable value and don't support having the variable as part of the path.
Another user requested the same feature: https://github.com/strongloop/loopback-boot/pull/181#issuecomment-216433322
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have the same issue , I have to use hard code now : "parse": { "body-parser#raw": { "paths": [ "/api/v1/Buckets/?/upload" ] } }, But expect the following one : "parse": { "body-parser#raw": { "paths": [ "${restApiRoot}/Buckets/?/upload" ] } },
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
go away stale bot
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.