|
@@ -2,6 +2,7 @@ package main
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
+ "github.com/gin-contrib/gzip"
|
|
|
"github.com/gin-gonic/gin"
|
|
|
"github.com/yhat/wsutil"
|
|
|
"net/http"
|
|
@@ -25,6 +26,9 @@ func StartServer() {
|
|
|
} else {
|
|
|
gin.SetMode(gin.ReleaseMode)
|
|
|
}
|
|
|
+ if ConfigData.CommonConfig.UseGZip {
|
|
|
+ ServerEngine.Use(gzip.Gzip(gzip.DefaultCompression))
|
|
|
+ }
|
|
|
ServerEngine.Use(CustomRecoveryMidware(ErrorLog, ConfigData.CommonConfig.IsDebugModeOn))
|
|
|
ServerEngine.Use(CustomAccessLogMidware(AccessLog, ErrorLog))
|
|
|
ErrorLog.Emit(LogLv_INFO, "Server", "Loading URL Router...")
|