Permalink
Browse files

Allowing users to specify application root

Users can set application route through options.root. This defaults to the original process.cwd().
  • Loading branch information...
1 parent 2ef3b73 commit 4e314aebd7e5e5d4bd3ce9e4886335eb0e463627 @aljimenez aljimenez committed Jul 14, 2014
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/mojito.js
View
4 lib/mojito.js
@@ -72,6 +72,7 @@ function Mojito(app, options) {
this._config = {};
this._options = options || {};
this._options.context = this._options.context || {};
+ this._options.root = this._options.root || process.cwd();
this._options.mojitoRoot = __dirname;
app.mojito = this;
@@ -96,7 +97,6 @@ Mojito.prototype._init = function () {
var app = this._app,
options = this._options,
context = options.context,
- appRoot = process.cwd(),
store; // reference to resource store
if (!app.mojito) {
@@ -105,8 +105,6 @@ Mojito.prototype._init = function () {
context.runtime = 'server';
- options.root = appRoot;
-
store = libstore.createStore(options);
this._configureAppInstance(app, store, options);

0 comments on commit 4e314ae

Please sign in to comment.