Skip to content

Commit

Permalink
Merge pull request #297 from DavidZey/master
Browse files Browse the repository at this point in the history
JIRA HUDEV-103 - add onPreStart app hook
  • Loading branch information
etduroch committed Nov 7, 2014
2 parents 5037406 + cd3f394 commit cb536ce
Show file tree
Hide file tree
Showing 5 changed files with 1,256 additions and 30 deletions.
34 changes: 19 additions & 15 deletions lib/app.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
// # app.js

var _ = require('underscore'),
path = require("path"),
var path = require("path"),
fs = require("fs"),
util = require("util"),
feather = require("./feather"),
featherConfig = require("feather-config"),
cluster = require('cluster'),
os = require('os');

/* ------------------------------------------------------------------ */
appHooks = null,
appDir = process.cwd(),
appName = path.basename(appDir),
appLibDir = path.join(appDir, 'lib'),
libDir = path.join(process.env.FEATHER_HOME, 'lib');

// Initialize the directory structure and name of the application.
if (fs.existsSync(appDir + '/app.js')) {
appHooks = require(appDir + "/app.js");
}

var appDir = process.cwd();
var appName = path.basename(appDir);
var appLibDir = path.join(appDir, 'lib');
var libDir = path.join(process.env.FEATHER_HOME, 'lib');
// Adding hook to allow monitoring service (like newrelic) to register before main modules are loaded
if (appHooks && appHooks.onPreStart && typeof appHooks.onPreStart === 'function') {
appHooks.onPreStart();
delete appHooks.onPreStart;
}

var _ = require('underscore'),
util = require("util"),
feather = require("./feather"),
featherConfig = require("feather-config"),
cluster = require('cluster'),
os = require('os');

/* ------------------------------------------------------------------ */
featherConfig.init({

appDir: appDir,
Expand Down Expand Up @@ -98,8 +104,6 @@ featherConfig.init({
} else {
if (! err) {

var appHooks = null;

if (fs.existsSync(appDir + '/app.js')) {
appHooks = require(appDir + "/app.js");
}
Expand Down
1 change: 0 additions & 1 deletion lib/feather-client/lib/underscore-min.js

This file was deleted.

Loading

0 comments on commit cb536ce

Please sign in to comment.