elixir_hello_world.ex 424 B

12345678910111213
  1. defmodule ElixirHelloWorld do
  2. use Application.Behaviour
  3. def start(_type, _args) do
  4. dispatch = :cowboy_router.compile([
  5. {:_, [{"/", ElixirHelloWorld.TopPageHandler, []}]}
  6. ])
  7. {:ok, _} = :cowboy.start_http(:http, 100,
  8. [port: 8080],
  9. [env: [dispatch: dispatch]])
  10. ElixirHelloWorld.Supervisor.start_link
  11. end
  12. end