Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eddycjy committed Mar 31, 2019
1 parent 50b3a3e commit dfa46b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"log"
"net/http"

"github.com/gin-gonic/gin"

"github.com/EDDYCJY/go-gin-example/models"
"github.com/EDDYCJY/go-gin-example/pkg/gredis"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
Expand All @@ -26,6 +28,8 @@ func init() {
// @license.name MIT
// @license.url https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE
func main() {
gin.SetMode(setting.ServerSetting.RunMode)

routersInit := routers.InitRouter()
readTimeout := setting.ServerSetting.ReadTimeout
writeTimeout := setting.ServerSetting.WriteTimeout
Expand Down
4 changes: 0 additions & 4 deletions routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/EDDYCJY/go-gin-example/middleware/jwt"
"github.com/EDDYCJY/go-gin-example/pkg/export"
"github.com/EDDYCJY/go-gin-example/pkg/qrcode"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/pkg/upload"
"github.com/EDDYCJY/go-gin-example/routers/api"
"github.com/EDDYCJY/go-gin-example/routers/api/v1"
Expand All @@ -21,11 +20,8 @@ import (
// InitRouter initialize routing information
func InitRouter() *gin.Engine {
r := gin.New()

r.Use(gin.Logger())

r.Use(gin.Recovery())
gin.SetMode(setting.ServerSetting.RunMode)

r.StaticFS("/export", http.Dir(export.GetExcelFullPath()))
r.StaticFS("/upload/images", http.Dir(upload.GetImageFullPath()))
Expand Down

0 comments on commit dfa46b5

Please sign in to comment.