From 38df6afb69a23e5405ae351dbed76807274fece8 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Tue, 12 Jun 2018 17:44:19 -0300 Subject: [PATCH] api: add cors stuff thing --- lib/api.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api.ex b/lib/api.ex index 836087e..07279d2 100644 --- a/lib/api.ex +++ b/lib/api.ex @@ -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,