Skip to content

Commit

Permalink
feat(server): add show current version
Browse files Browse the repository at this point in the history
  • Loading branch information
cooderl committed Mar 3, 2024
1 parent b4d3832 commit c3d3138
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { ConfigService } from '@nestjs/config';
import { json, urlencoded } from 'express';
import { NestExpressApplication } from '@nestjs/platform-express';
import { ConfigurationType } from './configuration';
import { join } from 'path';
import { join, resolve } from 'path';
import { readFileSync } from 'fs';

const packageJson = JSON.parse(
readFileSync(resolve(__dirname, '..', './package.json'), 'utf-8'),
);

const appVersion = packageJson.version;
console.log('appVersion: v' + appVersion);

async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
Expand Down

0 comments on commit c3d3138

Please sign in to comment.