Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Easier access of middleware with createProvider.

Also, expose middleware on require("onyx").
  • Loading branch information...
commit a594384342d9c17c3d95ddeb31151b15657f7cf8 1 parent fa5acf4
@reid reid authored
Showing with 15 additions and 5 deletions.
  1. +12 −0 lib/index.js
  2. +1 −3 lib/onyx.js
  3. +1 −1  package.json
  4. +1 −1  test/onyx.js
View
12 lib/index.js
@@ -0,0 +1,12 @@
+/*!
+ * YUI Onyx
+ * Copyright 2011 Yahoo! Inc.
+ * Licensed under the BSD license.
+ */
+
+var Onyx = exports.Onyx = require("./onyx");
+var provider = exports.provider = require("./middleware/onyx");
+
+exports.createProvider = function () {
+ return provider(new Onyx());
+};
View
4 lib/onyx.js
@@ -27,7 +27,7 @@ var mime = require("./mime");
* @class Onyx
* @constructor
*/
-function Onyx () {
+var Onyx = module.exports = function Onyx () {
}
var proto = Onyx.prototype;
@@ -281,5 +281,3 @@ proto.streamFiles = function (baton, cb) {
onyx.handle(200, baton, cb);
});
};
-
-exports.Onyx = Onyx;
View
2  package.json
@@ -13,7 +13,7 @@
"name": "Reid Burke",
"email": "me@reidburke.com"
}],
- "main": "./lib/onyx",
+ "main": "./lib/index",
"directories": {
"lib": "./lib"
},
View
2  test/onyx.js
@@ -9,7 +9,7 @@ var vows = require("vows");
var fs = require("fs");
var mockWritableStream = require("./lib/writable-stream.js");
-var Onyx = require("../lib/onyx").Onyx;
+var Onyx = require("../lib/index").Onyx;
function mockRequest () {
return {
Please sign in to comment.
Something went wrong with that request. Please try again.