Skip to content

Instantly share code, notes, and snippets.

@cvogt
Created October 9, 2016 17:10
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 cvogt/13797f084ba52b6f823b1508f980a6a6 to your computer and use it in GitHub Desktop.
Save cvogt/13797f084ba52b6f823b1508f980a6a6 to your computer and use it in GitHub Desktop.
object SwitchableConfig{
def main(args: Array[String]): Unit = {
val config = System.getProperty("config") match {
case "test" => Config("db.test-server.com",10000)
case "production" => Config("db.production-server.com",12345)
case _ => throw new Exception("unknown config: "+config)
}
Application.run( config )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment