Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Middleware static - Properly merge options. Allow getOnly to be confi…

…gured.
  • Loading branch information...
commit 5e059f4f609132b010d50b0ead66e29fb9733949 1 parent 0be5b3d
Ralph Holzmann authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/middleware/static.js
View
12 lib/middleware/static.js
@@ -46,16 +46,20 @@ var fs = require('fs')
* @api public
*/
+
+
+
exports = module.exports = function static(root, options){
- options = options || {};
+ options = utils.merge({
+ getOnly : true,
+ root : root
+ }, options);
// root required
- if (!root) throw new Error('static() root path required');
- options.root = root;
+ if (!options.root) throw new Error('static() root path required');
return function static(req, res, next) {
options.path = req.url;
- options.getOnly = true;
send(req, res, next, options);
};
};
Please sign in to comment.
Something went wrong with that request. Please try again.