This commit is contained in:
@@ -14,6 +14,11 @@ config :logger, level: logger_level
|
|||||||
|
|
||||||
config :logger, :console, format: {Logger.Formatter, :format}
|
config :logger, :console, format: {Logger.Formatter, :format}
|
||||||
|
|
||||||
|
cors_origin = System.get_env("CORS_ORIGIN", "*")
|
||||||
|
|
||||||
|
config :cors_plug,
|
||||||
|
origin: cors_origin
|
||||||
|
|
||||||
if System.get_env("PHX_SERVER") do
|
if System.get_env("PHX_SERVER") do
|
||||||
config :customer_service, CustomerServiceWeb.Endpoint, server: true
|
config :customer_service, CustomerServiceWeb.Endpoint, server: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ defmodule CustomerServiceWeb.Endpoint do
|
|||||||
plug Plug.MethodOverride
|
plug Plug.MethodOverride
|
||||||
plug Plug.Head
|
plug Plug.Head
|
||||||
plug Plug.Session, @session_options
|
plug Plug.Session, @session_options
|
||||||
plug CORSPlug, origin: ["http://localhost:3000"]
|
plug CORSPlug
|
||||||
plug CustomerServiceWeb.Router
|
plug CustomerServiceWeb.Router
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ controllers:
|
|||||||
LOG_LEVEL: info
|
LOG_LEVEL: info
|
||||||
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"
|
||||||
DATABASE_URL:
|
DATABASE_URL:
|
||||||
|
|||||||
Reference in New Issue
Block a user