set cors in api pipeline
Some checks failed
Build and Publish / build-release (push) Failing after 10s
Some checks failed
Build and Publish / build-release (push) Failing after 10s
This commit is contained in:
@@ -35,12 +35,6 @@ if amqp_url do
|
|||||||
config :policy_service, :amqp_url, amqp_url
|
config :policy_service, :amqp_url, amqp_url
|
||||||
end
|
end
|
||||||
|
|
||||||
cors_origin = System.get_env("CORS_ORIGIN", "*")
|
|
||||||
|
|
||||||
config :cors_plug,
|
|
||||||
origin: cors_origin,
|
|
||||||
allow_headers: ["*"]
|
|
||||||
|
|
||||||
# Zitadel Configuration
|
# Zitadel Configuration
|
||||||
|
|
||||||
# ## Using releases
|
# ## Using releases
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ defmodule PolicyServiceWeb.Endpoint do
|
|||||||
pass: ["*/*"],
|
pass: ["*/*"],
|
||||||
json_decoder: Phoenix.json_library()
|
json_decoder: Phoenix.json_library()
|
||||||
|
|
||||||
plug CORSPlug
|
|
||||||
plug Plug.MethodOverride
|
plug Plug.MethodOverride
|
||||||
plug Plug.Head
|
plug Plug.Head
|
||||||
plug Plug.Session, @session_options
|
plug Plug.Session, @session_options
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ defmodule PolicyServiceWeb.Router do
|
|||||||
alias PolicyServiceWeb.HealthController
|
alias PolicyServiceWeb.HealthController
|
||||||
|
|
||||||
pipeline :api do
|
pipeline :api do
|
||||||
|
plug CORSPlug,
|
||||||
|
origin: ["*"],
|
||||||
|
headers: ["authorization", "content-type", "accept", "x-organization-id"]
|
||||||
|
|
||||||
plug OpenApiSpex.Plug.PutApiSpec, module: PolicyServiceWeb.ApiSpec
|
plug OpenApiSpex.Plug.PutApiSpec, module: PolicyServiceWeb.ApiSpec
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user