this api will be the health check api, with the success health check will be return the application version and the runtime version
21 lines
522 B
Elixir
21 lines
522 B
Elixir
defmodule BlogserviceWeb.VersionController do
|
|
use BlogserviceWeb, :controller
|
|
|
|
def version(conn, _params) do
|
|
runtime_elixir = Application.spec(:elixir, :vsn)
|
|
runtime_application = Application.spec(:blogservice, :vsn)
|
|
runtime_phoenix = Application.spec(:phoenix, :vsn)
|
|
|
|
conn
|
|
|> response(:ok,
|
|
data: %{
|
|
runtime: %{
|
|
elixir: to_string(runtime_elixir),
|
|
phoenix: to_string(runtime_phoenix),
|
|
api: to_string(runtime_application)
|
|
}
|
|
}
|
|
)
|
|
end
|
|
end
|