Add page
This commit is contained in:
parent
f88c247a5c
commit
577e273a1b
5 changed files with 35 additions and 3 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
defmodule NullaWeb.PageHTML do
|
||||||
|
use NullaWeb, :html
|
||||||
|
|
||||||
|
embed_templates "templates/page/*"
|
||||||
|
end
|
||||||
|
|
||||||
|
defmodule NullaWeb.AuthHTML do
|
||||||
|
use NullaWeb, :html
|
||||||
|
|
||||||
|
embed_templates "templates/auth/*"
|
||||||
|
end
|
||||||
|
|
||||||
defmodule NullaWeb.ActorHTML do
|
defmodule NullaWeb.ActorHTML do
|
||||||
use NullaWeb, :html
|
use NullaWeb, :html
|
||||||
|
|
||||||
|
|
0
lib/nulla_web/components/templates/page/home.html.heex
Normal file
0
lib/nulla_web/components/templates/page/home.html.heex
Normal file
7
lib/nulla_web/controllers/page_controller.ex
Normal file
7
lib/nulla_web/controllers/page_controller.ex
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
defmodule NullaWeb.PageController do
|
||||||
|
use NullaWeb, :controller
|
||||||
|
|
||||||
|
def home(conn, _params) do
|
||||||
|
render(conn, :home, layout: false)
|
||||||
|
end
|
||||||
|
end
|
|
@ -17,6 +17,8 @@ defmodule NullaWeb.Router do
|
||||||
scope "/", NullaWeb do
|
scope "/", NullaWeb do
|
||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
|
get "/", PageController, :home
|
||||||
|
|
||||||
get "/.well-known/host-meta", HostmetaController, :index
|
get "/.well-known/host-meta", HostmetaController, :index
|
||||||
get "/.well-known/webfinger", WebfingerController, :index
|
get "/.well-known/webfinger", WebfingerController, :index
|
||||||
get "/.well-known/nodeinfo", NodeinfoController, :index
|
get "/.well-known/nodeinfo", NodeinfoController, :index
|
||||||
|
@ -24,9 +26,11 @@ defmodule NullaWeb.Router do
|
||||||
post "/inbox", InboxController, :inbox
|
post "/inbox", InboxController, :inbox
|
||||||
|
|
||||||
scope "/auth" do
|
scope "/auth" do
|
||||||
get "/sign_in", AuthController, :sign_in
|
get "/sign_in", AuthController, :sign_in_view
|
||||||
post "/sign_out", AuthController, :sign_out
|
post "/sign_in", AuthController, :sign_in
|
||||||
get "/sign_up", AuthController, :sign_up
|
delete "/sign_out", AuthController, :sign_out
|
||||||
|
get "/sign_up", AuthController, :sign_up_view
|
||||||
|
post "/sign_up", AuthController, :sign_up
|
||||||
end
|
end
|
||||||
|
|
||||||
scope "/users/:username" do
|
scope "/users/:username" do
|
||||||
|
|
9
test/nulla_web/controllers/page_controller_test.exs
Normal file
9
test/nulla_web/controllers/page_controller_test.exs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
defmodule NullaWeb.PageControllerTest do
|
||||||
|
use NullaWeb.ConnCase
|
||||||
|
|
||||||
|
test "GET /", %{conn: conn} do
|
||||||
|
conn = get(conn, ~p"/")
|
||||||
|
|
||||||
|
assert String.length(html_response(conn, 200)) > 0
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue