npm install @janiscommerce/settings- This method returns settings or settings by key. Example: Settings.get(); Example: Settings.get('database');
The setting file is a JSON with all the settings.
It's located in path/to/root/[MS_PATH]/config/.janiscommercerc.json.
[MS_PATH] : ENV variable. Default is empty.
{
"database": {
"core": {
"host": "my-host",
"user": "the-user"
},
"otherConn": {
"host": "my-other-host",
"user": "other-user"
}
},
"otherConfig": 123,
"mainPath": "/main/path/"
}const Settings = require('janiscommerce/settings');
const settings = Settings.get();const Settings = require('janiscommerce/settings');
const settings = Settings.get('database');