From 4eb496024defdf361658146fde8bd1053281d30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Hern=C3=A1ndez?= Date: Tue, 17 Oct 2023 12:09:30 +0200 Subject: [PATCH] Add version route (#6206) --- app/api/api.js | 1 + app/api/version/routes.ts | 8 ++++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/api/version/routes.ts diff --git a/app/api/api.js b/app/api/api.js index 9fb413c8b2..66e62c50f6 100644 --- a/app/api/api.js +++ b/app/api/api.js @@ -42,4 +42,5 @@ export default (app, server) => { require('./preserve/routes').PreserveRoutes(app); require('./relationships.v2/routes/routes').default(app); require('./stats/routes').default(app); + require('./version/routes').versionRoutes(app); }; diff --git a/app/api/version/routes.ts b/app/api/version/routes.ts new file mode 100644 index 0000000000..7a0e2cc1d4 --- /dev/null +++ b/app/api/version/routes.ts @@ -0,0 +1,8 @@ +import { config } from 'api/config'; +import { Application } from 'express'; + +export const versionRoutes = (app: Application) => { + app.get('/api/version', (_req, res) => { + res.json({ version: config.VERSION }); + }); +}; diff --git a/package.json b/package.json index 93e1e11d97..dac9d73261 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uwazi", - "version": "1.138.2", + "version": "1.138.3", "description": "Uwazi is a free, open-source solution for organising, analysing and publishing your documents.", "keywords": [ "react"