From 625e90c45883d67e1e7cb54802027d0f63cf41cb Mon Sep 17 00:00:00 2001 From: gorzki Date: Mon, 25 Mar 2019 10:18:01 +0100 Subject: [PATCH] Added controller to change 404 on / path --- api/web/controllers/root_controller.ex | 9 +++++++++ api/web/router.ex | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 api/web/controllers/root_controller.ex diff --git a/api/web/controllers/root_controller.ex b/api/web/controllers/root_controller.ex new file mode 100644 index 0000000..135444f --- /dev/null +++ b/api/web/controllers/root_controller.ex @@ -0,0 +1,9 @@ +defmodule Perseids.RootController do + use Perseids.Web, :controller + + def divider(conn, _params) do + conn + |> put_status(204) + |> json("ok") + end +end \ No newline at end of file diff --git a/api/web/router.ex b/api/web/router.ex index 4dbe1ce..36237d3 100644 --- a/api/web/router.ex +++ b/api/web/router.ex @@ -32,6 +32,10 @@ defmodule Perseids.Router do ####################### # Only for logged in "admin" user + scope "/", Perseids do + get "/", RootController, :divider + end + scope "/api/v1", Perseids do pipe_through :api pipe_through :authorized