File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 55 "github.com/android-sms-gateway/ca/pkg/core/http/jsonify"
66 "github.com/gofiber/fiber/v2"
77 "github.com/gofiber/fiber/v2/middleware/cors"
8+ "github.com/gofiber/fiber/v2/middleware/etag"
89 "github.com/gofiber/swagger"
910 "go.uber.org/fx"
1011 "go.uber.org/zap"
@@ -24,12 +25,17 @@ var Module = fx.Module(
2425 }),
2526 fx .Provide (newCSR , fx .Private ),
2627 fx .Invoke (func (app * fiber.App , csr * csrHandler , config Config ) {
27- api := app .Group ("/api/v1" )
28-
2928 apidoc .SwaggerInfo .Version = version .AppVersion
30- api .Get ("/docs/*" , swagger .New (swagger.Config {
31- Layout : "BaseLayout" ,
32- }))
29+ app .Use ("/docs/*" ,
30+ etag .New (etag.Config {
31+ Weak : true ,
32+ }),
33+ swagger .New (swagger.Config {
34+ Layout : "BaseLayout" ,
35+ }),
36+ )
37+
38+ api := app .Group ("/api/v1" )
3339
3440 if config .CORSAllowOrigins != "" {
3541 api .Use (cors .New (cors.Config {
@@ -43,7 +49,7 @@ var Module = fx.Module(
4349
4450 csr .Register (api .Group ("csr" ))
4551
46- api .Use (func (ctx * fiber.Ctx ) error {
52+ app .Use (func (ctx * fiber.Ctx ) error {
4753 return ctx .SendStatus (fiber .StatusNotFound )
4854 })
4955 }),
You can’t perform that action at this time.
0 commit comments