{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1572","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1572/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1572/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1572/events","html_url":"https://github.com/strongloop/loopback/issues/1572","id":99651120,"number":1572,"title":"middleware config is not merged properly","user":{"login":"rkmax","id":395707,"avatar_url":"https://avatars.githubusercontent.com/u/395707?v=3","gravatar_id":"","url":"https://api.github.com/users/rkmax","html_url":"https://github.com/rkmax","followers_url":"https://api.github.com/users/rkmax/followers","following_url":"https://api.github.com/users/rkmax/following{/other_user}","gists_url":"https://api.github.com/users/rkmax/gists{/gist_id}","starred_url":"https://api.github.com/users/rkmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkmax/subscriptions","organizations_url":"https://api.github.com/users/rkmax/orgs","repos_url":"https://api.github.com/users/rkmax/repos","events_url":"https://api.github.com/users/rkmax/events{/privacy}","received_events_url":"https://api.github.com/users/rkmax/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-07T13:51:25Z","updated_at":"2015-08-14T23:30:21Z","closed_at":null,"body":"I have the following settings\r\n\r\n## `middleware.json`\r\n```json\r\n{\r\n  \"initial:before\": {\r\n    \"loopback#favicon\": {}\r\n  },\r\n  \"initial\": {\r\n    \"compression\": {}\r\n  },\r\n  \"session\": {},\r\n  \"auth\": {},\r\n  \"parse\": {},\r\n  \"files\": {\r\n    \"loopback#static\": [\r\n      {\"params\": \"$!../client/ngapp/\"},\r\n      {\"params\": \"$!../\"}\r\n    ]\r\n  },\r\n  \"final\": {\r\n    \"loopback#urlNotFound\": {}\r\n  },\r\n  \"final:after\": {\r\n    \"errorhandler\": {}\r\n  }\r\n}\r\n```\r\n\r\n## `middleware.production.js`\r\n```js\r\nmodule.exports = {\r\n  files: {\r\n    'loopback#static': [\r\n      {params: '$!../client/dist/'}\r\n    ]\r\n  }\r\n};\r\n```\r\n\r\nYou can see here config-loader are merging the two files but the result is not the expected\r\n\r\n![captura de pantalla de 2015-08-07 08-48-53](https://cloud.githubusercontent.com/assets/395707/9137111/2cec13b0-3ce1-11e5-9c5f-11fae4aa846e.png)\r\n\r\nI want replace the `files` phase totally"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/131267020","html_url":"https://github.com/strongloop/loopback/issues/1572#issuecomment-131267020","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1572","id":131267020,"user":{"login":"rkmax","id":395707,"avatar_url":"https://avatars.githubusercontent.com/u/395707?v=3","gravatar_id":"","url":"https://api.github.com/users/rkmax","html_url":"https://github.com/rkmax","followers_url":"https://api.github.com/users/rkmax/followers","following_url":"https://api.github.com/users/rkmax/following{/other_user}","gists_url":"https://api.github.com/users/rkmax/gists{/gist_id}","starred_url":"https://api.github.com/users/rkmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkmax/subscriptions","organizations_url":"https://api.github.com/users/rkmax/orgs","repos_url":"https://api.github.com/users/rkmax/repos","events_url":"https://api.github.com/users/rkmax/events{/privacy}","received_events_url":"https://api.github.com/users/rkmax/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T23:30:21Z","updated_at":"2015-08-14T23:30:21Z","body":"@raymondfeng this it's correct\r\n\r\n## `middleware.json`\r\n```\r\n{\r\n  \"initial:before\": {\r\n    \"loopback#favicon\": {}\r\n  },\r\n  \"initial\": {\r\n    \"compression\": {}\r\n  },\r\n  \"session\": {},\r\n  \"auth\": {},\r\n  \"parse\": {},\r\n  \"files\": {\r\n    \"loopback#static\": [{\r\n      \"name\": \"myfiles\",\r\n      \"params\": [\"$!../client/ngapp/\", \"$!../\"]\r\n    }]\r\n  },\r\n  \"final\": {\r\n    \"loopback#urlNotFound\": {}\r\n  },\r\n  \"final:after\": {\r\n    \"errorhandler\": {}\r\n  }\r\n}\r\n```\r\n## `middleware.production.js`\r\n\r\n```\r\nmodule.exports = {\r\n  files: {\r\n    'loopback#static': [\r\n      {\"name\": \"myfiles\", params: '$!../client/dist/'}\r\n    ]\r\n  }\r\n};\r\n```"}}