Reputation: 689
I would like to have a pair ofdb-spec
maps with my database configuration for development and production.
But I can't find an easy way to detect the current execution environment. Need something like (defn db-spec [] (if (is-dev?) { dev-spec-here } { prod-spec-here }))
.
Maybe it can detect the current lein profile. No matter how I ask to google. Can't find how.
Upvotes: 1
Views: 338
Reputation: 91554
I'm fond of using environment variables for this (which can be set system wide for example in /etc/profile amongst other places). others prefer to pass a -D definition to the JVM
Upvotes: 1
Reputation: 4619
your code is okay, detect it depend your environment, like hostname
, IP arrdress
, global variable
etc.
Upvotes: 0