Is there an elegant way to access to the application version?
I’m serving the app version through an endpoint like this
def version(conn, _param) do
[_,_,{:vsn, version}|_] = Application.spec(:app_name)
text conn, version
end
Is there an elegant way to access to the application version?
I’m serving the app version through an endpoint like this
def version(conn, _param) do
[_,_,{:vsn, version}|_] = Application.spec(:app_name)
text conn, version
end
@version Mix.Project.config()[:version]
def version(conn, _param) do
text conn, @version
end
Application.spec(:app_name, :vsn)
@michalmuskala @NobbZ Thanks, both answers are useful.