diff --git a/lib/queen.ex b/lib/queen.ex index 0288f54..b626ce3 100644 --- a/lib/queen.ex +++ b/lib/queen.ex @@ -1,18 +1,12 @@ defmodule Queen do - @moduledoc """ - Documentation for `Queen`. - """ + import Plug.Conn - @doc """ - Hello world. + def init(opts) do + opts + end - ## Examples - - iex> Queen.hello() - :world - - """ - def hello do - :world + def call(conn, _opts) do + :logger.debug("saying hello") + send_resp(conn, 200, "hello from queen") end end diff --git a/lib/queen/application.ex b/lib/queen/application.ex index b03523f..5a9a22b 100644 --- a/lib/queen/application.ex +++ b/lib/queen/application.ex @@ -8,6 +8,7 @@ defmodule Queen.Application do @impl true def start(_type, _args) do children = [ + {Bandit, plug: Queen} # Starts a worker by calling: Queen.Worker.start_link(arg) # {Queen.Worker, arg} ] diff --git a/mix.exs b/mix.exs index add54e9..e9f401f 100644 --- a/mix.exs +++ b/mix.exs @@ -14,16 +14,14 @@ defmodule Queen.MixProject do # Run "mix help compile.app" to learn about applications. def application do [ - [applications: [:logger, :ecto_sqlite3, :ecto, :bandit, :plug]] - # extra_applications: [:logger] + # extra_applications: [:logger, :ecto_sqlite3, :ecto, :bandit, :plug] + extra_applications: [:logger] ] end # Run "mix help deps" to learn about dependencies. defp deps do [ - # {:dep_from_hexpm, "~> 0.3.0"}, - # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} {:bandit, "~> 1.2"}, {:plug, "~> 1.5"}, {:ecto_sqlite3, "~> 0.15"},