aboutsummaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-01-29 20:54:38 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-01-29 20:54:38 -0800
commit23d2d9109f060978705f3c7a8d2f8691b6f9107f (patch)
tree3cf100bf1ff6db933d6f7e80221a8ac93447adcd /config
parentc8138351c9737e3286a128c78f39e4f8a23e7bc9 (diff)
Add the possiblity to enable debug mode with an environment variable
Diffstat (limited to 'config')
-rw-r--r--config/config.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 4f182e5..bf4f43d 100644
--- a/config/config.go
+++ b/config/config.go
@@ -48,6 +48,11 @@ func (c *Config) getInt(key string, fallback int) int {
return v
}
+// HasDebugMode returns true if debug mode is enabled.
+func (c *Config) HasDebugMode() bool {
+ return c.get("DEBUG", "") != ""
+}
+
// BaseURL returns the application base URL.
func (c *Config) BaseURL() string {
return c.get("BASE_URL", defaultBaseURL)