refactor: add version in app config

This commit is contained in:
Ali BARIN
2022-08-04 21:18:18 +02:00
parent ff09a836b4
commit a624a8d8b5
3 changed files with 6 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ type AppConfig = {
postgresHost: string;
postgresUsername: string;
postgresPassword?: string;
version: string;
postgresEnableSsl: boolean;
baseUrl: string;
encryptionKey: string;
@@ -44,6 +45,7 @@ const appConfig: AppConfig = {
port,
appEnv: appEnv,
isDev: appEnv === 'development',
version: process.env.npm_package_version,
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
postgresPort: parseInt(process.env.POSTGRES_PORT || '5432'),
postgresHost: process.env.POSTGRES_HOST || 'localhost',

View File

@@ -1,6 +1,8 @@
import appConfig from '../../config/app';
const healthcheck = () => {
return {
version: process.env.npm_package_version,
version: appConfig.version,
}
};

View File

@@ -125,7 +125,7 @@ class Telemetry {
diagnosticInfo() {
this.track('diagnosticInfo', {
automatischVersion: process.env.npm_package_version,
automatischVersion: appConfig.version,
serveWebAppSeparately: appConfig.serveWebAppSeparately,
operatingSystem: {
type: os.type(),