Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
morozovsk committed Jun 14, 2012
1 parent b9e8aab commit 015288a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 10 additions & 1 deletion index.js
Expand Up @@ -3,6 +3,15 @@ module.exports.controllers = {}
module.exports.models = {}

module.exports.init = function(app) {
if (app.set('applicationDirectory') === undefined) app.set('applicationDirectory', '/app/');
if (app.set('moduleDirectory') === undefined) app.set('moduleDirectory', '/modules/');
if (app.set('controllerDirectory') === undefined) app.set('controllerDirectory', '/controllers/');
if (app.set('modelDirectory') === undefined) app.set('modelDirectory', '/models/');
if (app.set('viewDirectory') === undefined) app.set('viewDirectory', '/views/');
if (app.set('defaultModule') === undefined) app.set('defaultModule', 'index');
if (app.set('defaultController') === undefined) app.set('defaultController', 'index');
if (app.set('defaultAction') === undefined) app.set('defaultAction', 'index');

module.exports.app = app;
var util = require('util');
var path = require('path');
Expand Down Expand Up @@ -126,7 +135,7 @@ module.exports.init = function(app) {
}

var _render = function () {
return response.render(request.params.controller + '/' + request.params.action, controller._locals());
return response.render(path.join(request.params.controller, request.params.action), controller._locals());
}

var _json = function () {
Expand Down
7 changes: 3 additions & 4 deletions package.json
@@ -1,14 +1,13 @@
{
"name": "mvc",
"description": "mvc for expess",
"version": "0.0.2",
"version": "0.0.3",
"homepage": "https://github.com/morozovsk/mvc",
"repository": "https://github.com/morozovsk/mvc",
"author": "morozovsk <morozovsk@gmail.com> (https://github.com/morozovsk)",
"keywords": ["mvc", "zf", "zend", "php", "express", "expressjs", "framework", "sinatra", "web", "rest", "restful", "router"],
"keywords": ["mvc", "express", "expressjs", "connect", "framework", "zf", "zend", "php"],
"engines": { "node": "*" },
"dependencies": {
"express": "*",
"ejs": "*"
"express": "*"
}
}
2 changes: 1 addition & 1 deletion samples/sample-without-modules/index.js
Expand Up @@ -16,10 +16,10 @@ app.configure(function(){
app.set('moduleDirectory', '/modules/');
app.set('controllerDirectory', '/controllers/');
app.set('modelDirectory', '/models/');
app.set('viewDirectory', '/views/');
app.set('defaultModule', 'index');
app.set('defaultController', 'index');
app.set('defaultAction', 'index');
app.set('viewDirectory', '/views/');
app.use(express.bodyParser());
app.use(express.cookieParser('secret'));
app.use(express.session({secret: 'secret'}));
Expand Down

0 comments on commit 015288a

Please sign in to comment.