Skip to content

Commit

Permalink
Add /version endpoint which displays version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
kennsippell committed Jan 23, 2024
1 parent 889e361 commit b999c67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/routes/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FastifyInstance, FastifyRequest } from 'fastify';
import Auth from '../lib/authentication';
import { ChtApi } from '../lib/cht-api';
import { Config } from "../config";
import { version as appVersion } from '../package.json';

export default async function authentication(fastify: FastifyInstance) {
const unauthenticatedOptions = {
Expand Down Expand Up @@ -58,5 +59,9 @@ export default async function authentication(fastify: FastifyInstance) {
fastify.get('/_healthz', unauthenticatedOptions, () => {
return 'OK';
});

fastify.get('/version', unauthenticatedOptions, () => {
return appVersion;
});
};

0 comments on commit b999c67

Please sign in to comment.