Uh oh!
There was an error while loading. Please reload this page.
compiler: resolve paths in middleware params - #74
Conversation
Introduce a convention for specifying relative paths in middleware
params: values prefixed with `$!` and starting with `./` or `../`
are resolved relatively to `middleware.json`.
Example:
{
"files": {
"loopback#static": {
"params": "$!../client"
},
"loopback#static": {
"params": "$!./public"
}
}
}ritch
commented
Dec 1, 2014
Maybe it requires a name eg. |
bajtos
commented
Dec 1, 2014
I expect this feature will be used quite frequently, therefore I prefer to keep the prefix as short as possible. Also note that the path is relative to the |
raymondfeng
commented
Dec 1, 2014
I'm leaning toward to use typical variable delimiters for JS templates. For example, It will allow us to use existing template engines to parse the templates and inject values. I'm fine to have a shortcut for this special case with a prefix such as '#!' (why not use #!?). |
bajtos
commented
Dec 1, 2014
|
bajtos
commented
Dec 1, 2014
That may be a good solution for #75 👍 |
raymondfeng
commented
Dec 1, 2014
I'm fine to use |
…leware-params compiler: resolve paths in middleware params
Introduce a convention for specifying relative paths in middleware params: values prefixed with
$!and starting with./or../are resolved relatively tomiddleware.json.Example (
server/middleware.json)/to @ritch@raymondfeng please review, especially whether the prefix value makes sense to you too. It was inspired by hashbang (
#!) used by client-side MVC frameworks.I have discovered this use case while reworking the template scaffolded by
slc loopbackas part of strongloop/loopback-workspace#167