Created
October 17, 2012 21:39
-
-
Save robdodson/3908432 to your computer and use it in GitHub Desktop.
static.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports = module.exports = function static(root, options){ | |
| options = options || {}; | |
| // root required | |
| if (!root) throw new Error('static() root path required'); | |
| options.root = root; | |
| return function static(req, res, next) { | |
| console.log('!!! STATIC HIT !!!'); | |
| console.log(req.path); | |
| options.path = req.url; | |
| options.getOnly = true; | |
| send(req, res, next, options); | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment