fp/services/bright/lib/bright_web/controllers/page_controller.ex

34 lines
774 B
Elixir
Raw Normal View History

2025-01-03 14:45:35 +00:00
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
2025-01-11 12:47:23 +00:00
def health(conn, _params) do
data = %{message: "OK", status: "success"}
json(conn, data)
end
2025-01-03 14:45:35 +00:00
def redirect_test(conn, _params) do
render(conn, :home, layout: false)
end
end