compiles and runs from iex, but how to run outside that
This commit is contained in:
parent
0a8740b4b8
commit
248574eabc
3 changed files with 10 additions and 17 deletions
20
lib/queen.ex
20
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
|
||||
|
|
|
@ -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}
|
||||
]
|
||||
|
|
6
mix.exs
6
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"},
|
||||
|
|
Loading…
Reference in a new issue