diff --git a/porte/main.go b/porte/main.go index 62f56d7..3767c5f 100644 --- a/porte/main.go +++ b/porte/main.go @@ -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"))