api: add cors stuff thing

This commit is contained in:
Luna Mendes 2018-06-12 17:44:19 -03:00
parent f3727dcd8a
commit 38df6afb69

View file

@ -5,7 +5,7 @@ defmodule Elstat.API.CurrentStatus do
data = Elstat.Manager.get_current_state()
req = :cowboy_req.reply(200,
%{"content-type" => "text/json"},
%{"content-type" => "text/json", "Access-Control-Allow-Origin" => "*"},
Poison.encode!(data),
req0
)
@ -20,7 +20,7 @@ defmodule Elstat.API.Status do
graph = Elstat.Manager.get_graph_state()
req = :cowboy_req.reply(200,
%{"content-type" => "text/json"},
%{"content-type" => "text/json", "Access-Control-Allow-Origin" => "*"},
Poison.encode!(%{
status: status,
graph: graph,