Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add default view helpers

  • Loading branch information...
commit 84ae465cb5a10d3eed30f60e9cb2c21a5057febd 1 parent 261df9a
@chriso chriso authored
Showing with 7 additions and 3 deletions.
  1. +1 −1  index.js
  2. +4 −2 lib/server.js
  3. +2 −0  lib/view_helpers.js
View
2  index.js
@@ -1,2 +1,2 @@
-module.exports = requre('./lib/shoes');
+module.exports = require('./lib/shoes');
View
6 lib/server.js
@@ -6,6 +6,7 @@ var express = require('express')
, fs = require('fs')
, utils = require('./utils')
, log = require('sslog')
+ , default_helpers = require('./view_helpers')
, server = module.exports;
/**
@@ -41,7 +42,8 @@ var Server = exports.Server = function (root, config) {
*/
Server.prototype.viewHelpers = function (helpers) {
- this.view_helpers = helpers;
+ helpers = utils.merge({}, helpers);
+ this.view_helpers = utils.merg(helpers, default_helpers);
}
/**
@@ -324,7 +326,7 @@ Server.prototype.useragentMiddleware = function () {
if (next.pattern.test(ua)) {
redirect = next.redirect;
}
- }
+ });
}
if (redirect && redirect !== request.url) {
return response.redirect(redirect);
View
2  lib/view_helpers.js
@@ -0,0 +1,2 @@
+var helpers = exports;
+
Please sign in to comment.
Something went wrong with that request. Please try again.