Initial Commit
This commit is contained in:
3
lib/diamondtail.ex
Normal file
3
lib/diamondtail.ex
Normal file
@@ -0,0 +1,3 @@
|
||||
defmodule Diamondtail do
|
||||
|
||||
end
|
||||
21
lib/diamondtail/application.ex
Normal file
21
lib/diamondtail/application.ex
Normal file
@@ -0,0 +1,21 @@
|
||||
defmodule Diamondtail.Application do
|
||||
# See https://hexdocs.pm/elixir/Application.html
|
||||
# for more information on OTP Applications
|
||||
@moduledoc false
|
||||
|
||||
use Application
|
||||
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
children = [
|
||||
# Starts a worker by calling: Diamondtail.Worker.start_link(arg)
|
||||
# {Diamondtail.Worker, arg}
|
||||
{Plug.Cowboy, scheme: :http, plug: Diamondtail.Router, options: [port: 4001]}
|
||||
]
|
||||
|
||||
# See https://hexdocs.pm/elixir/Supervisor.html
|
||||
# for other strategies and supported options
|
||||
opts = [strategy: :one_for_one, name: Diamondtail.Supervisor]
|
||||
Supervisor.start_link(children, opts)
|
||||
end
|
||||
end
|
||||
5
lib/diamondtail/population.ex
Normal file
5
lib/diamondtail/population.ex
Normal file
@@ -0,0 +1,5 @@
|
||||
defmodule Diamondtail.Population do
|
||||
defmodule Genes do
|
||||
|
||||
end
|
||||
end
|
||||
22
lib/diamondtail/router.ex
Normal file
22
lib/diamondtail/router.ex
Normal file
@@ -0,0 +1,22 @@
|
||||
defmodule Diamondtail.Router do
|
||||
use Plug.Router
|
||||
|
||||
plug Plug.Logger
|
||||
plug :match
|
||||
plug :dispatch
|
||||
|
||||
plug Plug.Parsers,
|
||||
parsers: [:json],
|
||||
json_decoder: JSON
|
||||
|
||||
get "/" do
|
||||
send_resp(conn, 200, JSON.encode!(%{
|
||||
apiversion: "1",
|
||||
author: "kodicraft",
|
||||
color: "#8cd9ff",
|
||||
head: "trans-rights-scarf",
|
||||
tail: "hook",
|
||||
version: Mix.Project.config()[:version]
|
||||
}))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user