feat: no log

master
Evan Chen 2021-12-17 01:31:56 +08:00
parent 8621dc370e
commit 2c68c8cddb
1 changed files with 16 additions and 0 deletions

View File

@ -2,11 +2,27 @@ package server
import (
"net/http"
"path/filepath"
"github.com/gin-gonic/gin"
"github.com/rs/xid"
)
func DefaultSkipLog(c *gin.Context) bool {
switch filepath.Ext(c.Request.URL.Path) {
case ".css":
fallthrough
case ".woff2":
fallthrough
case ".map":
fallthrough
case ".js":
return true
default:
return false
}
}
type Response struct {
Status int `json:"status"`
ID string `json:"id"`