sergei/lib/server.ex

21 lines
265 B
Elixir
Raw Normal View History

2023-06-06 21:01:17 +00:00
defmodule Server do
use Plug.Router
plug(:match)
plug(:dispatch)
get "/" do
conn
|> send_resp(200, "Ok")
end
match _ do
conn
|> send_resp(404, "Page not found")
end
def start_link(_) do
Plug.Cowboy.http(Server, [])
2023-06-06 21:01:17 +00:00
end
end