kopia lustrzana https://github.com/reiver/greatape
fix(server): 🐛 error mime type
rodzic
060c184daf
commit
5902d2e50f
|
@ -65,6 +65,17 @@ func New() IServer {
|
||||||
DisableStartupMessage: true,
|
DisableStartupMessage: true,
|
||||||
Views: html.New("./views", ".html"),
|
Views: html.New("./views", ".html"),
|
||||||
BodyLimit: int(bodyLimit),
|
BodyLimit: int(bodyLimit),
|
||||||
|
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
|
||||||
|
code := fiber.StatusInternalServerError
|
||||||
|
|
||||||
|
if e, ok := err.(*fiber.Error); ok {
|
||||||
|
code = e.Code
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.Set(fiber.HeaderContentType, fiber.MIMEApplicationJSONCharsetUTF8)
|
||||||
|
|
||||||
|
return ctx.Status(code).SendString(err.Error())
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
framework.Static("/media", config.UPLOAD_PATH)
|
framework.Static("/media", config.UPLOAD_PATH)
|
||||||
|
|
Ładowanie…
Reference in New Issue