From b9f5d98b101a53c9b1c35e672b711ad9a51154c5 Mon Sep 17 00:00:00 2001 From: Adam Monsen Date: Thu, 12 Dec 2024 09:34:25 -0800 Subject: [PATCH] expose version via /api/version --- app/controllers/api/version_controller.rb | 12 ++++++++++++ config/routes.rb | 1 + 2 files changed, 13 insertions(+) create mode 100644 app/controllers/api/version_controller.rb diff --git a/app/controllers/api/version_controller.rb b/app/controllers/api/version_controller.rb new file mode 100644 index 00000000..e817a24b --- /dev/null +++ b/app/controllers/api/version_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Api + class VersionController < ApiBaseController + skip_before_action :authenticate_user! + skip_authorization_check + + def show + render json: { version: Docuseal.version } + end + end +end diff --git a/config/routes.rb b/config/routes.rb index dd568316..14ef656b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -52,6 +52,7 @@ Rails.application.routes.draw do resources :form_events, only: %i[index], path: 'form/:type' resources :submission_events, only: %i[index], path: 'submission/:type' end + get 'version', to: 'version#show' end resources :verify_pdf_signature, only: %i[create]