Skip to content

An Elixir Plug-based CORS middleware for Phoenix Framework.

License

Notifications You must be signed in to change notification settings

KamilLelonek/ex_cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ex_cors

Build Status

An Elixir Plug-based CORS middleware for Phoenix Framework.

Installation

The package can be installed by adding ex_cors to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_cors, "~> 0.2"},
    # ...
  ]
end

After you're done, run mix deps.get in your terminal to fetch and compile all dependencies.

Usage

ex_cors is intended to work with Phoenix.Enpoint. The only thing you have to do in order to make it working is to modify your_app/lib/your_app/web/endpoint.ex as follows:

defmodule YourApp.Endpoint do
  use Phoenix.Enpoint, otp_app: :your_app

  # ...
  plug ExCors.AllowCorsRequests
  plug YourApp.Router
  # ...
end

About

An Elixir Plug-based CORS middleware for Phoenix Framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages