{"action":"reopened","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/2544","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/2544/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/2544/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/2544/events","html_url":"https://github.com/balderdashy/sails/issues/2544","id":53793255,"number":2544,"title":"Different loading of user configuration in subdirectories","user":{"login":"kumpelblase2","id":765835,"avatar_url":"https://avatars.githubusercontent.com/u/765835?v=3","gravatar_id":"","url":"https://api.github.com/users/kumpelblase2","html_url":"https://github.com/kumpelblase2","followers_url":"https://api.github.com/users/kumpelblase2/followers","following_url":"https://api.github.com/users/kumpelblase2/following{/other_user}","gists_url":"https://api.github.com/users/kumpelblase2/gists{/gist_id}","starred_url":"https://api.github.com/users/kumpelblase2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumpelblase2/subscriptions","organizations_url":"https://api.github.com/users/kumpelblase2/orgs","repos_url":"https://api.github.com/users/kumpelblase2/repos","events_url":"https://api.github.com/users/kumpelblase2/events{/privacy}","received_events_url":"https://api.github.com/users/kumpelblase2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-08T19:54:33Z","updated_at":"2015-01-09T22:29:31Z","closed_at":null,"body":"I have a small issue with the way user configurations are loaded into `sails.config` when it comes to configuration files in subdirectories.\r\nLets suppose we have this directory tree:\r\n```\r\nconfig/\r\n- env/\r\n  ...\r\n- locals/\r\n  ...\r\n- fruits/\r\n  - apple.js\r\n  - banana.js\r\n...\r\n```\r\n\r\nWhen I now load my app, wouldn't the most intuitive way of accessing the values of `banana` be `sails.config.fruits.banana` ? Because right now, all config files of subdirectories get merged into the main config value, without sub-directives which depict the directory they're in, thus resulting in `sails.config.banana`. Since `locals` and `env` have their own loading process, this shouldn't be much of an issue right?\r\n\r\nThis would not only tidy up the config variable (because you can put similar configuration files into a subdirectory instead of polluting the main namespace), but also allows you to separate sails specific configuration and user made configuration. For example, when I want to have a config for some policies of my internal logic, I could then put them under `config/app/policies.js` and it would not add to the policies for sails.\r\n\r\nTL:DR: A configuration file under `config/sub/file.js` should be accessible via `sails.config.sub.file` and not via `sails.config.file`."}}