Skip to content

Commit

Permalink
AppEngine: update /version endpoint
Browse files Browse the repository at this point in the history
Update /version endpoint to return microservice version of API (#890)

Signed-off-by: Osman Hadzic <[email protected]>
  • Loading branch information
osmanhadzic committed Jan 22, 2024
1 parent d12bab6 commit 847f994
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/astarte_appengine_api/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ config :astarte_appengine_api, swagger_ui: true

config :astarte_appengine_api, :max_results_limit, 10000

config :astarte_appengine_api, :microserivce_verison, "1.2.0-dev"

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

defmodule Astarte.AppEngine.APIWeb.VersionController do
use Astarte.AppEngine.APIWeb, :controller

@version Mix.Project.config()[:version]
alias Astarte.AppEngine.API.Config

def show(conn, _params) do
render(conn, "show.json", %{version: @version})
render(conn, "show.json", %{
version: Application.fetch_env!(:astarte_appengine_api, :microserivce_verison)
})
end
end

0 comments on commit 847f994

Please sign in to comment.