PlugCors

A CORS Plug

Usage:

plug PlugCors, origins: ["test.origin.test", "*.domain.com"], methods: ["GET", "POST"], headers: ["Authorization"]

You can now also define the parameters inside of your elixir config instead if you wish. Parameters defined directly on the plug take precedence over the ones in config

config :plug_cors, 
  origins: ["test.origin.test", "*.domain.com"], 
  methods: ["GET", "POST"], 
  headers: ["Authorization"]

Parameters:

Summary

call(conn, config)
init(opts)

Functions

call(conn, config)
init(opts)