refactor: move cors handler inside api party
This commit is contained in:
parent
2f64f18e24
commit
37cdbfbc0d
3
main.go
3
main.go
|
@ -64,7 +64,6 @@ func main() {
|
||||||
app := iris.New()
|
app := iris.New()
|
||||||
// Enable Gzip compression for responses
|
// Enable Gzip compression for responses
|
||||||
app.Use(iris.Compression)
|
app.Use(iris.Compression)
|
||||||
app.UseRouter(cors.New().Handler())
|
|
||||||
|
|
||||||
// Serve static files from the embedded directory at the app's root path
|
// Serve static files from the embedded directory at the app's root path
|
||||||
_ = embedFrontend
|
_ = embedFrontend
|
||||||
|
@ -73,6 +72,8 @@ func main() {
|
||||||
api := app.Party("/api")
|
api := app.Party("/api")
|
||||||
v1 := api.Party("/v1")
|
v1 := api.Party("/v1")
|
||||||
|
|
||||||
|
api.UseRouter(cors.New().Handler())
|
||||||
|
|
||||||
tusHandler := tus.Init()
|
tusHandler := tus.Init()
|
||||||
|
|
||||||
// Register the AccountController with the MVC framework and attach it to the "/api/account" path
|
// Register the AccountController with the MVC framework and attach it to the "/api/account" path
|
||||||
|
|
Loading…
Reference in New Issue