Unverified Commit 16d22358 authored by Mathis Chenuet's avatar Mathis Chenuet Committed by GitHub

Update proxy example to http-proxy-middleware ^1 (#13507)

The current example doesn't work if one try to reproduce it with a recent version of http-proxy-middleware.
parent ad145d34
......@@ -10,7 +10,7 @@
},
"devDependencies": {
"cross-env": "^5.0.1",
"http-proxy-middleware": "^0.17.4"
"http-proxy-middleware": "^1.0.4"
},
"scripts": {
"dev": "cross-env NODE_ENV=development PORT=3000 node server.js",
......
......@@ -28,9 +28,9 @@ app
// Set up the proxy.
if (dev && devProxy) {
const proxyMiddleware = require('http-proxy-middleware')
const { createProxyMiddleware } = require('http-proxy-middleware')
Object.keys(devProxy).forEach(function (context) {
server.use(proxyMiddleware(context, devProxy[context]))
server.use(context, createProxyMiddleware(devProxy[context]))
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment