From 1d9f169c70108962cc6a4c216de5d4f7ce2bfd5d Mon Sep 17 00:00:00 2001 From: alex4386 Date: Wed, 23 Jun 2021 01:01:18 +0900 Subject: [PATCH] feat: make version available on admin endpoints --- src/routes/v1/admin/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/routes/v1/admin/index.ts b/src/routes/v1/admin/index.ts index 61578aff..737a15e2 100644 --- a/src/routes/v1/admin/index.ts +++ b/src/routes/v1/admin/index.ts @@ -4,6 +4,7 @@ import { Utils } from '../../../common'; import { getTokenFromRequest } from '../../../common/token'; import { NodeEnvironment } from '../../../interface'; import config from '../../../resources/config'; +import { info as packageJson } from '../../../resources/package'; import { sendMeilingError } from '../meiling/error'; import { MeilingV1ErrorType } from '../meiling/interfaces'; import appsAdminHandler from './apps'; @@ -74,6 +75,12 @@ const adminV1Plugin = (app: FastifyInstance, opts: FastifyPluginOptions, done: ( version: 1, engine: 'Meiling Project', api: 'Scarlet Mansion Access Control Admin', + about: { + name: packageJson.name, + description: packageJson.description, + repository: packageJson.repository, + version: packageJson.version, + }, }); });