Last active
September 15, 2018 14:53
-
-
Save KamilLelonek/c1d7134e337f5e9185138ec5ce78cfc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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