fix cors_plug
All checks were successful
Build and Publish / build-release (push) Successful in 1m21s
All checks were successful
Build and Publish / build-release (push) Successful in 1m21s
This commit is contained in:
@@ -35,6 +35,11 @@ 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
|
||||||
|
|
||||||
# ## Using releases
|
# ## Using releases
|
||||||
#
|
#
|
||||||
# If you use `mix release`, you need to explicitly enable the server
|
# If you use `mix release`, you need to explicitly enable the server
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ defmodule PolicyService.Events.Policy do
|
|||||||
|
|
||||||
defmodule AllQuotesReceived do
|
defmodule AllQuotesReceived do
|
||||||
@derive Jason.Encoder
|
@derive Jason.Encoder
|
||||||
defstruct [:id, :org_id, :quote_count]
|
defstruct [:id, :quote_count]
|
||||||
end
|
end
|
||||||
|
|
||||||
defmodule QuoteAccepted do
|
defmodule QuoteAccepted do
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ defmodule PolicyServiceWeb.Endpoint do
|
|||||||
pass: ["*/*"],
|
pass: ["*/*"],
|
||||||
json_decoder: Phoenix.json_library()
|
json_decoder: Phoenix.json_library()
|
||||||
|
|
||||||
plug CORSPlug, origin: ["http://localhost:3000"]
|
plug CORSPlug
|
||||||
plug Plug.MethodOverride
|
plug Plug.MethodOverride
|
||||||
plug Plug.Head
|
plug Plug.Head
|
||||||
plug Plug.Session, @session_options
|
plug Plug.Session, @session_options
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ controllers:
|
|||||||
LOG_LEVEL: debug
|
LOG_LEVEL: debug
|
||||||
MIX_ENV: prod
|
MIX_ENV: prod
|
||||||
PORT: "8080"
|
PORT: "8080"
|
||||||
|
CORS_ORIGIN:
|
||||||
|
value: "*"
|
||||||
PHX_HOST: "0.0.0.0"
|
PHX_HOST: "0.0.0.0"
|
||||||
PHX_SERVER: "true"
|
PHX_SERVER: "true"
|
||||||
RABBITMQ_HOST:
|
RABBITMQ_HOST:
|
||||||
|
|||||||
Reference in New Issue
Block a user