Skip to content

Commit

Permalink
Set CORS headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed Nov 9, 2016
1 parent 18d0a14 commit 6c15f8d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/http/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ defmodule Tokenizer.HTTP.Endpoint do
plug Plug.MethodOverride
plug Plug.Head

plug Corsica, origins: "*"

# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Tokenizer.Mixfile do
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger, :phoenix, :phoenix_ecto, :cowboy, :httpoison, :poison,
[applications: [:logger, :phoenix, :phoenix_ecto, :cowboy, :httpoison, :poison, :corsica,
:ecto, :postgrex, :ecto_enum, :timex, :credit_card, :confex, :eview],
mod: {Tokenizer, []}]
end
Expand Down Expand Up @@ -60,6 +60,7 @@ defmodule Tokenizer.Mixfile do
{:httpoison, "~> 0.9.2"},
{:credit_card, "~> 1.0"},
{:timex, "~> 3.0"},
{:corsica, "~> 0.5"},
{:ex_doc, ">= 0.0.0", only: [:dev, :test]},
{:excoveralls, "~> 0.5", only: [:dev, :test]},
{:dogma, "> 0.1.0", only: [:dev, :test]},
Expand Down
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"combine": {:hex, :combine, "0.9.2", "cd3c8721f378ebe032487d8a4fa2ced3181a456a3c21b16464da8c46904bb552", [:mix], []},
"confex": {:hex, :confex, "1.4.1", "762cf6346b48b67010604f614e09c2219d68ee64f38bedc49be9e6ae40689cb9", [:mix], []},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []},
"corsica": {:hex, :corsica, "0.5.0", "eb5b2fccc5bc4f31b8e2b77dd15f5f302aca5d63286c953e8e916f806056d50c", [:mix], [{:cowboy, ">= 1.0.0", [hex: :cowboy, optional: false]}, {:plug, ">= 0.9.0", [hex: :plug, optional: false]}]},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
"credit_card": {:hex, :credit_card, "1.0.0", "559cce8a2908843ee4af61ef0edc4c2b75faa584d61f05815a3ddbdc257b7469", [:mix], []},
Expand Down

0 comments on commit 6c15f8d

Please sign in to comment.