/**
 * Module dependencies.
 */
var fs = require('fs')
  , path = require('path')
  , Server = require('./server');


/**
 * Create an OAuth 2.0 server.
 *
 * @return {Server}
 * @api public
 */
function createServer() {
  var server = new Server();
  return server;
}

// expose createServer() as the module
exports = module.exports = createServer;

/**
 * Export `.createServer()`.
 */
exports.createServer = createServer;


/**
 * Export middleware.
 */
exports.errorHandler = require('./middleware/errorHandler');

/**
 * Auto-load bundled grants.
 */
exports.grant = {};
 
fs.readdirSync(__dirname + '/grant').forEach(function(filename) {
  if (/\.js$/.test(filename)) {
    var name = path.basename(filename, '.js');
    function load() { return require('./grant/' + name); }
    exports.grant.__defineGetter__(name, load);
  }
});

// alias grants
exports.grant.authorizationCode = exports.grant.code;
exports.grant.implicit = exports.grant.token;

/**
 * Auto-load bundled exchanges.
 */
exports.exchange = {};
 
fs.readdirSync(__dirname + '/exchange').forEach(function(filename) {
  if (/\.js$/.test(filename)) {
    var name = path.basename(filename, '.js');
    function load() { return require('./exchange/' + name); }
    exports.exchange.__defineGetter__(name, load);
  }
});

// alias exchanges
exports.exchange.code = exports.exchange.authorizationCode;

/**
 * Export errors.
 */
exports.AuthorizationError = require('./errors/authorizationerror');
exports.TokenError = require('./errors/tokenerror');

@@ -711,32 +711,43 @@
 ame, '.js');%0A   
+ var load =
  function load()
@@ -732,36 +732,32 @@
 load = function 
-load
 () %7B return requ
@@ -773,32 +773,33 @@
 ant/' + name); %7D
+;
 %0A    exports.gra
@@ -1173,16 +1173,27 @@
 s');%0A   
+ var load =
  functio
@@ -1194,20 +1194,16 @@
 unction 
-load
 () %7B ret
@@ -1238,16 +1238,17 @@
 name); %7D
+;
 %0A    exp

Update grant/ and exchange/ requires to use function expressions for compatibility with strict mode