34 lines
774 B
Elixir
34 lines
774 B
Elixir
defmodule BrightWeb.PageController do
|
|
use BrightWeb, :controller
|
|
|
|
def home(conn, _params) do
|
|
# The home page is often custom made,
|
|
# so skip the default app layout.
|
|
# render(conn, :home, layout: false)
|
|
|
|
# send_resp(conn, 201, "")
|
|
conn
|
|
|> put_status(202)
|
|
|> render(:home, layout: false)
|
|
# redirect(conn, to: ~p"/redirect_test")
|
|
# redirect(conn, external: "https://elixir-lang.org/")
|
|
end
|
|
|
|
def about(conn, _params) do
|
|
render(conn, :about, layout: false)
|
|
end
|
|
|
|
def api(conn, _params) do
|
|
render(conn, :api, layout: false)
|
|
end
|
|
|
|
def health(conn, _params) do
|
|
data = %{message: "OK", status: "success"}
|
|
json(conn, data)
|
|
end
|
|
|
|
def redirect_test(conn, _params) do
|
|
render(conn, :home, layout: false)
|
|
end
|
|
end
|