index.community/backend/lib/backend_web/controllers/graph_controller.ex

14 lines
298 B
Elixir
Raw Normal View History

2019-07-14 11:47:06 +00:00
defmodule BackendWeb.GraphController do
use BackendWeb, :controller
alias Backend.Api
action_fallback BackendWeb.FallbackController
def index(conn, _params) do
nodes = Api.list_nodes()
edges = Api.list_edges()
render(conn, "index.json", nodes: nodes, edges: edges)
end
end