# How to read a property from a config?
Reading a project-level config property
define the property in lottery/conf/Smile.conf file. For example:
search.url="www.google.com"to read the property:
import
com.iteration3.SmileUse
Smile.conf.getString()api to read the propertyimport com.iteration3.Smile val searchUrl:Option[String] = Smile.conf.getString("search.url")By default, Smile.conf.get api's return an option but if you are sure the property would be defined, prefix with
Mustas followsval searchUrl:String = Smile.conf.getStringMust("search.url")For more details Types of config properties?
Reading a module-level config property
define the property the respective module's conf. For example, to access a property only inside LotteryDomain module, define it in lottery/modules/lottery/LotteryDomain/conf/lotterydomain.conf file.
to read the property, use module DomainObject.conf as shown below:
val bucketName = LotteryDomainObject.conf.getString("s3.bucket.name")
REFERENCES