Hi Vitheya,
The following JavaScript example shows how you can get either a single property from the properties file, or get all properties as an object:
import config from 'mx:config'
// Get a deployment property
console.log('example.name : ' + config.deployment.example.name);
console.log('example.company : ' + config.deployment.example.company);
console.log('example.badentry: ' + config.deployment.example.badentry);
// Print all deployment properties
console.log(JSON.stringify(config.deployment, null, ' '));
When using the following contents in deployment.properties:
example.name=Roger
example.company=Rocket Software
it will give the following console output:
2024-07-15T11:16:09,272 [25724] INFO javascript.console - example.name : Roger
2024-07-15T11:16:09,272 [25724] INFO javascript.console - example.company : Rocket Software
2024-07-15T11:16:09,272 [25724] INFO javascript.console - example.badentry: undefined
2024-07-15T11:16:09,272 [25724] INFO javascript.console - {
"example": {
"name": "Roger",
"company": "Rocket Software"
}
}
Hope this helps,
Regards,
Roger van Valen