Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #887 from lirantal/feature/app-startup-version-number
Browse files Browse the repository at this point in the history
Adding MEAN.JS version information as part of the startup info when app loads
  • Loading branch information
lirantal committed Sep 8, 2015
2 parents 522cc6b + a12746e commit d1a9119
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ var initGlobalConfig = function () {
// Merge config files
var config = _.merge(defaultConfig, environmentConfig);

// read package.json for MEAN.JS project information
var pkg = require(path.resolve('./package.json'));
config.meanjs = pkg;

// We only extend the config object with the local.js custom/local environment if we are on
// production or development environment. If test environment is used we don't merge it with local.js
// to avoid running test suites on a prod/dev environment (which delete records and make modifications)
Expand Down
3 changes: 3 additions & 0 deletions config/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ module.exports.start = function start(callback) {
if (process.env.NODE_ENV === 'secure') {
console.log(chalk.green('HTTPs:\t\t\t\ton'));
}
console.log(chalk.green('App version:\t\t\t' + config.meanjs.version));
if (config.meanjs['meanjs-version'])
console.log(chalk.green('MEAN.JS version:\t\t\t' + config.meanjs['meanjs-version']));
console.log('--');

if (callback) callback(app, db, config);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "meanjs",
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
"version": "0.4.1",
"meanjs-version": "0.4.1",
"private": false,
"author": "https://github.com/meanjs/mean/graphs/contributors",
"license": "MIT",
Expand Down

0 comments on commit d1a9119

Please sign in to comment.