Skip to content
Permalink
Browse files

add appmode, add validation locale support

Signed-off-by: Toby Yan <me@tobyan.com>
  • Loading branch information...
toby1991 committed Mar 7, 2019
1 parent 111da09 commit 3a12af2371b4b34fa456bf37bccca0bc6ce21df0
Showing with 25 additions and 276 deletions.
  1. +2 −1 .gitignore
  2. +12 −0 config/kernel.go
  3. +1 −1 go.mod
  4. +0 −272 go.sum
  5. +9 −1 main.go
  6. +1 −1 routes/versions/v1.go
@@ -1,3 +1,4 @@
.idea
framework
.env.json
.env.json
go.sum
@@ -1,4 +1,16 @@
package config

import (
"github.com/gin-gonic/gin"
"github.com/totoval/framework/config"
)

func Initialize() {
setAppMode()
}

func setAppMode(){
if config.GetString("app.env") == "production" {
gin.SetMode(gin.ReleaseMode)
}
}
2 go.mod
@@ -4,7 +4,7 @@ require (
github.com/coreos/etcd v3.3.10+incompatible
github.com/gin-gonic/gin v1.3.0
github.com/jinzhu/gorm v1.9.2
github.com/totoval/framework v0.1.0-nightly.1551929293
github.com/totoval/framework v0.1.0-nightly.1551956163
github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43 // indirect
github.com/urfave/cli v1.20.0
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd // indirect
Oops, something went wrong.

0 comments on commit 3a12af2

Please sign in to comment.
You can’t perform that action at this time.