Replace json encoder and decoder
All checks were successful
release-nightly / build-docker (push) Successful in 1m1s

This commit is contained in:
2023-12-16 12:35:42 +08:00
parent 79e060da5d
commit cea4114019
4 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package hypertext
import (
jsoniter "github.com/json-iterator/go"
"time"
"github.com/gofiber/fiber/v2"
@ -16,6 +17,8 @@ func InitServer() *fiber.App {
ServerHeader: "RoadSign",
DisableStartupMessage: true,
EnableIPValidation: true,
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
Prefork: viper.GetBool("performance.prefork"),
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
})