strongloop/loopback-boot — pull request #74 by bajtos (2014-11-28 11:25:59+00:00)
Title: 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 to `middleware.json`.

Example (`server/middleware.json`)

{
"files": {
"loopback#static": {
"params": "$!../client"
// resolved to `client`
},
"loopback#static": {
"params": "$!./public"
// resolved to `server/public`
}
}
}

/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 loopback` as part of https://github.com/strongloop/loopback-workspace/issues/167