*
* Options:
*
* - path path from which to serve static files. Defaults to <root>/public
* - bufferSize buffers size to use for streaming files. Defaults to 65536 (8kb)
*
* @param {hash} options
* @api private
*/
init: function(options) {
options = options || {}
options.path = options.path || set('root') + '/public'
init: function(config) {
config = config || {}
config.path = config.path || set('root') + '/public'
// Routes
get('/public/*', function(file){
this.sendfile(options.path + '/' + file)
this.sendfile(config.path + '/' + file)
})
// Request
return self.respond(304, null)
self.header('Content-Length', stat.size)
self.header('ETag', etag)
options.bufferSize = options.bufferSize
|| set('static buffer size')
|| config.bufferSize
|| 65536
if (stat.size > options.bufferSize)
return self.stream(fs.createReadStream(path, options))
fs.readFile(path, function(err, content){