Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Last active September 15, 2018 14:53
Show Gist options
  • Save KamilLelonek/c1d7134e337f5e9185138ec5ce78cfc1 to your computer and use it in GitHub Desktop.
Save KamilLelonek/c1d7134e337f5e9185138ec5ce78cfc1 to your computer and use it in GitHub Desktop.
defmodule MinimalServer.Endpoint do
# ...
require Logger
def start_link(_opts) do
with {:ok, [port: port] = config} <- Application.fetch_env(:minimal_server, __MODULE__) do
Logger.info("Starting server at http://localhost:#{port}/")
Plug.Adapters.Cowboy2.http(__MODULE__, [], config)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment