api: add cors stuff thing

This commit is contained in:
Luna Mendes 2018-06-12 17:44:19 -03:00
parent f3727dcd8a
commit 38df6afb69
1 changed files with 2 additions and 2 deletions

View File

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