Current section

Files

Jump to
raxx lib raxx not_found.html.eex
Raw

lib/raxx/not_found.html.eex

<h1>Welcome to Raxx</h1>
<p>Get started with your web application.</p>
<pre>
defmodule <%= Macro.to_string(example_module) %> do
use Raxx.Server
@impl Raxx.Server
def handle_request(%{method: :GET, path: []}, _state) do
Raxx.response(:ok)
|> Raxx.set_header("content-type", "text/html")
|> Raxx.set_body(<%= Raxx.html_escape("<h1>Home Page</h1>") %>)
end
def handle_request(_request, _state) do
Raxx.response(:not_found)
|> Raxx.set_header("content-type", "text/html")
|> Raxx.set_body(<%= Raxx.html_escape("<h1>Ooops! Page not found.</h1>") %>)
end
end
</pre>
<p>See <a href="https://hexdocs.pm/raxx/Raxx.Server.html">documentation</a> for full details.</p>