Application version on Phoenix

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