Cristiano Piemontese 0cc8c760d0
Add telepoison (#148)
* add telepoison

* rename

* rename file too, duh

* rename test file

* port updates

* add standard workflow
2023-06-04 08:23:03 -06:00

23 lines
556 B
Elixir

Application.ensure_all_started(:opentelemetry)
Application.ensure_all_started(:opentelemetry_api)
defmodule TestServer do
use Plug.Router
plug(:match)
plug(:dispatch)
match "/status/:status_code" do
send_resp(conn, String.to_integer(status_code), "Here's that status code you ordered!")
end
match _ do
send_resp(conn, 200, "It's polite to reply!")
end
end
child_spec = [{Plug.Cowboy, scheme: :http, plug: TestServer, options: [port: 8000]}]
{:ok, _pid} = Supervisor.start_link(child_spec, strategy: :one_for_one)
ExUnit.start()