diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -39,10 +39,15 @@ import ( const OPENBILLS_VERSION = "v0.0.1" -func main() { - log.Printf("\x1b[46m\x1b[30m[info]\x1b[0m Starting OpenBills Server %s\n", OPENBILLS_VERSION) +func init() { + if viper.GetBool("production_mode") { + gin.SetMode(gin.ReleaseMode) + } +} +func main() { r := gin.New() + r.SetTrustedProxies([]string{"127.0.0.1"}) r.GET("/info", serverInfo) @@ -60,5 +65,6 @@ func main() { item.Routes(protected) } + log.Printf("\x1b[46m\x1b[30m[info]\x1b[0m Running OpenBills Server %s\n", OPENBILLS_VERSION) r.Run(":" + viper.GetString("port")) } |