diff --git a/lib/serve.js b/lib/serve.js index 260b2aeb..ec6571b5 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -45,7 +45,10 @@ function promiseCallback(promise, callback) { function createHandler(dir) { return function(request, response) { - var func = request.path.split("/").filter(function(e) { + // handle proxies without path re-writes (http-servr) + var cleanPath = request.path.replace(/^\/.netlify\/functions/, '') + + var func = cleanPath.split("/").filter(function(e) { return e; })[0]; var module = path.join(process.cwd(), dir, func);