Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Easier access of middleware with createProvider.

Also, expose middleware on require("onyx").
  • Loading branch information...
commit a594384342d9c17c3d95ddeb31151b15657f7cf8 1 parent fa5acf4
Reid Burke reid authored
12 lib/index.js
... ... @@ -0,0 +1,12 @@
  1 +/*!
  2 + * YUI Onyx
  3 + * Copyright 2011 Yahoo! Inc.
  4 + * Licensed under the BSD license.
  5 + */
  6 +
  7 +var Onyx = exports.Onyx = require("./onyx");
  8 +var provider = exports.provider = require("./middleware/onyx");
  9 +
  10 +exports.createProvider = function () {
  11 + return provider(new Onyx());
  12 +};
4 lib/onyx.js
@@ -27,7 +27,7 @@ var mime = require("./mime");
27 27 * @class Onyx
28 28 * @constructor
29 29 */
30   -function Onyx () {
  30 +var Onyx = module.exports = function Onyx () {
31 31 }
32 32
33 33 var proto = Onyx.prototype;
@@ -281,5 +281,3 @@ proto.streamFiles = function (baton, cb) {
281 281 onyx.handle(200, baton, cb);
282 282 });
283 283 };
284   -
285   -exports.Onyx = Onyx;
2  package.json
@@ -13,7 +13,7 @@
13 13 "name": "Reid Burke",
14 14 "email": "me@reidburke.com"
15 15 }],
16   - "main": "./lib/onyx",
  16 + "main": "./lib/index",
17 17 "directories": {
18 18 "lib": "./lib"
19 19 },
2  test/onyx.js
@@ -9,7 +9,7 @@ var vows = require("vows");
9 9 var fs = require("fs");
10 10 var mockWritableStream = require("./lib/writable-stream.js");
11 11
12   -var Onyx = require("../lib/onyx").Onyx;
  12 +var Onyx = require("../lib/index").Onyx;
13 13
14 14 function mockRequest () {
15 15 return {

0 comments on commit a594384

Please sign in to comment.
Something went wrong with that request. Please try again.