Skip to content

Commit

Permalink
get app version for display via package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Nov 23, 2023
1 parent 8207936 commit 80c3949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Problem from 'api-problem';
import querystring from 'querystring';

import { DEFAULTCORS } from './src/components/constants';
import { name as appName, version as appVersion } from './package.json';
import { getLogger, httpLogger } from './src/components/log';
import { getGitRevision, readIdpList } from './src/components/utils';
import v1Router from './src/routes/v1';
Expand Down Expand Up @@ -55,9 +56,9 @@ appRouter.get('/api', (_req: Request, res: Response): void => {
res.status(200).json({
app: {
gitRev: state.gitRev,
name: process.env.npm_package_name,
name: appName,
nodeVersion: process.version,
version: process.env.npm_package_version
version: appVersion
},
endpoints: ['/api/v1'],
versions: [1]
Expand All @@ -72,7 +73,7 @@ appRouter.get('/config', (_req: Request, res: Response, next: (err: unknown) =>
...config.get('frontend'),
gitRev: state.gitRev,
idpList: readIdpList(),
version: process.env.npm_package_version
version: appVersion
});
} catch (err) {
next(err);
Expand Down
2 changes: 1 addition & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "resolveJsonModule": true, /* Enable importing .json files. */
"resolveJsonModule": true, /* Enable importing .json files. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
Expand Down

0 comments on commit 80c3949

Please sign in to comment.