From 37cdbfbc0d3ba7ac07ef2e87ba96187d15afd819 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 15 Aug 2023 09:20:54 -0400 Subject: [PATCH] refactor: move cors handler inside api party --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c4feaed..73069bb 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,6 @@ func main() { app := iris.New() // Enable Gzip compression for responses app.Use(iris.Compression) - app.UseRouter(cors.New().Handler()) // Serve static files from the embedded directory at the app's root path _ = embedFrontend @@ -73,6 +72,8 @@ func main() { api := app.Party("/api") v1 := api.Party("/v1") + api.UseRouter(cors.New().Handler()) + tusHandler := tus.Init() // Register the AccountController with the MVC framework and attach it to the "/api/account" path