Skip to content

Instantly share code, notes, and snippets.

@adamw
Created July 16, 2019 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamw/798336defa598d49ff6023afaf2edb28 to your computer and use it in GitHub Desktop.
Save adamw/798336defa598d49ff6023afaf2edb28 to your computer and use it in GitHub Desktop.
case class DBConfig(username: String, password: String, url: String,
migrateOnStart: Boolean, driver: String, connectThreadPoolSize: Int) {
override def toString: String =
s"DBConfig($username,***,$url,$migrateOnStart,$driver,$connectThreadPoolSize)"
}
case class HttpConfig(host: String, port: Int)
// ... other config classes ...
case class Config(db: DBConfig, api: HttpConfig, email: EmailConfig,
passwordReset: PasswordResetConfig, user: UserConfig)
trait ConfigModule extends StrictLogging {
lazy val config: Config = pureconfig.loadConfigOrThrow[Config]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment