'use strict';

var fs   = require('fs');
var path = require('path');
var glob = require('glob');

exports.register = function (server, options, next) {
  var globOptions = {
    nodir: true,
    strict: true,
    cwd: options.cwd || process.cwd(),
    ignore: options.ignore
  }

  var files = glob.sync(options.routes, globOptions);

  files.forEach(function (file) {
    server.route(require(globOptions.cwd + '/' + file));
  });

  next();
};

exports.register.attributes = {
  multiple: false,
  pkg: require('../package.json')
};

@@ -283,40 +283,225 @@
 var 
-files = glob.sync(options.routes
+patterns = %5B%5D;%0A%0A  if (options.routes.constructor === Array) %7B%0A    patterns = options.routes;%0A  %7D else %7B%0A    patterns = %5B options.routes %5D;%0A  %7D%0A%0A  patterns.forEach(function (pattern) %7B%0A    var files = glob.sync(pattern
 , gl
@@ -513,16 +513,18 @@
 ions);%0A%0A
+  
   files.
@@ -553,16 +553,18 @@
 ) %7B%0A    
+  
 server.r
@@ -614,11 +614,18 @@
 ;%0A  
+ 
+ 
 %7D);
+%0A  %7D)
 %0A%0A  

add logic to handle paths.