Skip to content

Commit

Permalink
Create start task
Browse files Browse the repository at this point in the history
  • Loading branch information
philosodad committed May 8, 2016
1 parent 6a78a9a commit fc64b01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/loggex.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
defmodule Loggex do
require IEx
use Application
use Elixometer
use Plug.Router
alias Loggex.Repo
Expand All @@ -11,7 +12,7 @@ defmodule Loggex do
plug :match
plug :dispatch

def start do
def start _type, _args do
Cowboy.http Loggex, [], port: 6438
Repo.start_link
end
Expand All @@ -27,4 +28,7 @@ defmodule Loggex do
send_resp(conn, 200, "Request Logged")
end

get "/ping" do
send_resp(conn, 200, "pong")
end
end
5 changes: 4 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ defmodule Loggex.Mixfile do
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger, :cowboy, :plug, :postgrex, :ecto, :httpoison, :elixometer]]
[
mod: {Loggex, []},
applications: [:logger, :cowboy, :plug, :postgrex, :ecto, :httpoison, :elixometer]
]
end

# Dependencies can be Hex packages:
Expand Down

0 comments on commit fc64b01

Please sign in to comment.