How can I programatically detect if I'm in production mode or development mode in revel framework?
Asked
Active
Viewed 223 times
1 Answers
5
There are exported global variables in the revel
package:
var (
RunMode string // Application-defined (by default, "dev" or "prod")
DevMode bool // if true, RunMode is a development mode.
)
So for example:
if revel.DevMode {
// Running in development mode
} else {
// Production mode
}

icza
- 389,944
- 63
- 907
- 827
-
I actually found this on my own but still thanks! :D I have another question for you aswell. – Pablo Jomer Jul 07 '15 at 09:38