export default class Middleware {

  /**
  * Constructor
  */
  constructor(key, value) {
    key = key.toLowerCase();

    // In case of simple middleware
    if (key == "middleware") {
      return this.simpleMiddleware(value);
    }

    if (OPTIONS[key]) {
      return OPTIONS[key].init(value);
    }
  }

  /**
  * Get middleware from middleware options
  * @param {array} middlewares [an array of middleware location in api/middleware]
  * @return {array} middleware function
  */
  simpleMiddleware(middlewares) {
    return middlewares
    .map( middle => middle.split('.') )
    .map( middle => {
      if (middle.length == 2) return require("../api/middleware/" + middle[0])[middle[1]];
      return require("../api/middleware/index")[middle[0]];
    });
  }
}

@@ -266,16 +266,51 @@
   return
+ %7B%0A        key: key,%0A        value:
  OPTIONS
@@ -322,24 +322,32 @@
 .init(value)
+%0A      %7D
 ;%0A    %7D%0A  %7D%0A

Add the key and value in option