Add some new handler
This commit is contained in:
@@ -85,8 +85,12 @@ func (server *WebServer) routes() *chi.Mux {
|
|||||||
compressor := middleware.NewCompressor(flate.DefaultCompression)
|
compressor := middleware.NewCompressor(flate.DefaultCompression)
|
||||||
router := chi.NewRouter()
|
router := chi.NewRouter()
|
||||||
router.Use(
|
router.Use(
|
||||||
|
middleware.RequestID,
|
||||||
|
middleware.RealIP,
|
||||||
compressor.Handler,
|
compressor.Handler,
|
||||||
middleware.Recoverer,
|
middleware.Recoverer,
|
||||||
|
middleware.Logger,
|
||||||
|
|
||||||
cors.Handler(cors.Options{
|
cors.Handler(cors.Options{
|
||||||
AllowedOrigins: []string{"https://*", "http://*"},
|
AllowedOrigins: []string{"https://*", "http://*"},
|
||||||
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
|
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
|
||||||
|
|||||||
Reference in New Issue
Block a user