Initial Commit

This commit is contained in:
2025-11-08 11:50:18 +01:00
commit 8412a2b954
20 changed files with 2766 additions and 0 deletions

3
lib/diamondtail.ex Normal file
View File

@@ -0,0 +1,3 @@
defmodule Diamondtail do
end

View 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

View File

@@ -0,0 +1,5 @@
defmodule Diamondtail.Population do
defmodule Genes do
end
end

22
lib/diamondtail/router.ex Normal file
View 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