Skip to content

Commit d739bb3

Browse files
authored
Merge pull request netlify#50 from netlify/cleanPaths
add support for http-server
2 parents 4526939 + 269f57d commit d739bb3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/serve.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ function promiseCallback(promise, callback) {
4545

4646
function createHandler(dir) {
4747
return function(request, response) {
48-
var func = request.path.split("/").filter(function(e) {
48+
// handle proxies without path re-writes (http-servr)
49+
var cleanPath = request.path.replace(/^\/.netlify\/functions/, '')
50+
51+
var func = cleanPath.split("/").filter(function(e) {
4952
return e;
5053
})[0];
5154
var module = path.join(process.cwd(), dir, func);

0 commit comments

Comments
 (0)