add cors_plug
This commit is contained in:
parent
c31ae53790
commit
5c47b2aacb
3 changed files with 7 additions and 0 deletions
|
@ -17,5 +17,10 @@ config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Chiya.Finch
|
|||
# Do not print debug messages in production
|
||||
config :logger, level: :debug
|
||||
|
||||
config :cors_plug,
|
||||
origin: ["app://obsidian.md"],
|
||||
max_age: 86400,
|
||||
methods: ["GET", "POST"]
|
||||
|
||||
# Runtime production configuration, including reading
|
||||
# of environment variables, is done on config/runtime.exs.
|
||||
|
|
|
@ -38,6 +38,7 @@ defmodule ChiyaWeb.Endpoint do
|
|||
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :chiya
|
||||
end
|
||||
|
||||
plug CORSPlug
|
||||
plug Phoenix.LiveDashboard.RequestLogger,
|
||||
param_key: "request_logger",
|
||||
cookie_key: "request_logger"
|
||||
|
|
1
mix.exs
1
mix.exs
|
@ -33,6 +33,7 @@ defmodule Chiya.MixProject do
|
|||
defp deps do
|
||||
[
|
||||
{:bcrypt_elixir, "~> 3.0"},
|
||||
{:cors_plug, "~> 3.0"},
|
||||
{:earmark, "~> 1.4"},
|
||||
{:ecto_autoslug_field, "~> 3.0"},
|
||||
{:ecto_sql, "~> 3.6"},
|
||||
|
|
Loading…
Reference in a new issue