Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] Expose adapted version of `stack` so it can be used with HttpPr…

…oxy instances not created by `httpProxy.createServer()`
  • Loading branch information...
commit 5d6e6b9f78eb98b28db01490a36b23c1aade133f 1 parent be3a0d8
@indexzero indexzero authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/node-http-proxy.js
View
6 lib/node-http-proxy.js
@@ -115,10 +115,10 @@ exports.setMaxSockets = function (value) {
};
//
-// stack
+// ### function stack (middlewares, proxy)
// adapted from https://github.com/creationix/stack
//
-function stack (middlewares, proxy) {
+exports.stack = function stack (middlewares, proxy) {
var handle;
middlewares.reverse().forEach(function (layer) {
var child = handle;
@@ -206,7 +206,7 @@ exports.createServer = function () {
}
if (middleware.length > 1) {
- handler = callback = stack(middleware, proxy);
+ handler = callback = exports.stack(middleware, proxy);
}
else if (middleware.length) {
//
Please sign in to comment.
Something went wrong with that request. Please try again.