Your super fast (I hope it will be super fast), reliable, modular, extensible HTTP/2 web server in Elixir.
Lye has two ways of interacting with HTTP traffic:
defmodule MyPlug do
import Plug.Conn
def init(options) do: options
def call(conn, _opts) do
conn
|> put_resp_content_type("text/plain")
|> send_resp(200, "Hello world")
end
end
Lye::Plug.https MyPlug, []
# => {:ok, #PID<...>}
If available in Hex, the package can be installed as:
-
Add lye to your list of dependencies in
mix.exs
:def deps do [{:lye, "~> 0.0.1"}] end
-
Ensure lye is started before your application:
def application do [applications: [:lye]] end