Skip to content

Commit b1b31a9

Browse files
added proxy file
1 parent 4f003e0 commit b1b31a9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

setupProxy.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const proxy = require('http-proxy-middleware')
2+
// this proxy code allows the use of .netlify/function in both development and production
3+
module.exports = function(app){
4+
app.use(
5+
proxy(
6+
"/.netlify/functions", {
7+
target: "http://localhost:9000",
8+
pathRewrite: {
9+
"^/\\.netlify/functions": ""
10+
}
11+
}
12+
)
13+
)
14+
}

0 commit comments

Comments
 (0)