Skip to content

Commit

Permalink
Add /version endpoint (#105)
Browse files Browse the repository at this point in the history
Add /version endpoint
  • Loading branch information
Mythicaeda authored Aug 20, 2024
1 parent 1c7044f commit 2bca160
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/packages/health/health.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Express } from 'express';
import { getEnv } from '../../env.js';

export default (app: Express) => {
/**
Expand Down Expand Up @@ -29,4 +30,30 @@ export default (app: Express) => {
const uptimeMinutes = process.uptime() / 60;
res.json({ timestamp, uptimeMinutes });
});

/**
* @swagger
* /version:
* get:
* produces:
* - application/json
* responses:
* 200:
* description: Version metrics
* content:
* application/json:
* schema:
* properties:
* gateway_version:
* description: The current version of the Aerie Gateway.
* type: string
* summary: Get the current version of the Gateway and Database Schema
* tags:
* - Version
*/
app.get('/version', async (_, res) => {
res.json({
version: getEnv().VERSION,
});
});
};

0 comments on commit 2bca160

Please sign in to comment.