Skip to content

Commit

Permalink
Bugfix app name and version not appearing from directly invoking node
Browse files Browse the repository at this point in the history
Previously we depended on an NPM wrapper to populate those values. Since
invoking the application directly with node bypasses the wrapper, those
values are no longer populated. This commit ensures that we draw the right
values from the package.json file directly.

Signed-off-by: Jeremy Ho <jujaga@gmail.com>
  • Loading branch information
jujaga committed Nov 21, 2023
1 parent 8819a35 commit 7bfc551
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const config = require('config');
const cors = require('cors');
const express = require('express');

const { name: appName, version: appVersion } = require('./package.json');
const { AuthMode, DEFAULTCORS } = require('./src/components/constants');
const log = require('./src/components/log')(module.filename);
const httpLogger = require('./src/components/log').httpLogger;
Expand Down Expand Up @@ -90,8 +91,8 @@ apiRouter.get('/', (_req, res) => {
app: {
authMode: state.authMode,
gitRev: state.gitRev,
name: process.env.npm_package_name,
nodeVersion: process.version,
name: appName,
nodeVersion: appVersion,
privacyMask: config.has('server.privacyMask'),
version: process.env.npm_package_version
},
Expand Down

0 comments on commit 7bfc551

Please sign in to comment.