application.ex 698 B

12345678910111213141516171819202122
  1. defmodule HttpSunucu.Application do
  2. # See https://hexdocs.pm/elixir/Application.html
  3. # for more information on OTP Applications
  4. @moduledoc false
  5. use Application
  6. def start(_type, _args) do
  7. # List all child processes to be supervised
  8. children = [
  9. # Starts a worker by calling: HttpSunucu.Worker.start_link(arg)
  10. # {HttpSunucu.Worker, arg},
  11. Plug.Adapters.Cowboy2.child_spec(scheme: :http, plug: SimpleServer.Router, options: [port: 8085])
  12. ]
  13. # See https://hexdocs.pm/elixir/Supervisor.html
  14. # for other strategies and supported options
  15. opts = [strategy: :one_for_one, name: HttpSunucu.Supervisor]
  16. Supervisor.start_link(children, opts)
  17. end
  18. end