Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document the onyxProvider.

  • Loading branch information...
commit 830fd7c8e3ad64d43c8187498f09074c53b3ff4a 1 parent e4cabfb
@reid authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 lib/middleware/onyx.js
View
17 lib/middleware/onyx.js
@@ -1,22 +1,31 @@
/*!
- * YUI Mocha
+ * YUI Onyx
* Copyright 2011 Yahoo! Inc.
* Licensed under the BSD license.
*/
/**
- * Provides streaming file functions.
+ * Provides Connect middleware that
+ * provides `res.streamFiles`.
*
- * Connect middleware.
+ * @method onyxProvider
+ * @param {Onyx} onyx An instance of Onyx.
*/
module.exports = function onyxProvider (onyx) {
+ /**
+ * Connect middleware that provides `res.streamFiles`.
+ */
return function streamFilesFilter (req, res, next) {
/**
* Respond to this request by sending files.
*
- * @param {Array|String} file The fully-qualified path to the file.
+ * If a file isn't found or is a directory, don't handle the request
+ * and pass through to the next middleware. (This usually yields a 404.)
+ *
+ * @param {Array|String} files The fully-qualified path to the file.
+ * @param {Object} config Configuration to pass through to Onyx.
*/
res.streamFiles = function streamFilesResponder (files, config) {
if (!config) {
Please sign in to comment.
Something went wrong with that request. Please try again.