add cors middleware

This commit is contained in:
2023-01-31 23:06:45 -03:00
parent 5fa4d4e78a
commit 2ed4b14cf1
2 changed files with 19 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
"os/signal"
"syscall"
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/middlewares"
"github.com/gorilla/handlers"
"github.com/julienschmidt/httprouter"
)
@@ -26,6 +27,7 @@ func Initialize() *httprouter.Router {
func Serve(router *httprouter.Router) {
newRouter := handlers.CombinedLoggingHandler(os.Stdout, router)
newRouter = handlers.CompressHandler(newRouter)
newRouter = middlewares.Cors(newRouter)
idleConnsClosed := make(chan struct{})