Skip to content

Commit

Permalink
feat(porte): allow all cors
Browse files Browse the repository at this point in the history
  • Loading branch information
yyewolf committed Nov 2, 2023
1 parent 2b5338c commit 93ae3fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions porte/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ import (
func main() {
e := echo.New()

// CORS
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
origin := c.Request().Header.Get("Origin")
c.Response().Header().Set("Access-Control-Allow-Origin", origin)
return next(c)
}
})

routes(e)

e.Logger.Fatal(e.Start(":8080"))
Expand Down

0 comments on commit 93ae3fa

Please sign in to comment.