Repository navigation
|
I can't get the example here to work. If I change the version of Steps to reproduce: Create a file const createProxyMiddleware = require("http-proxy-middleware");
module.exports = function (app) {
app.use(createProxyMiddleware("/api", {
target: "http://localhost:5000",
changeOrigin: true
}));
}Go to http://localhost:3000 and get a connection refused error. I'm guessing I'm missing something trivial here as I can't find any info about this. |
Answered by
tomap
Mar 31, 2022
Replies: 1 comment 1 reply
|
When you use the last version, you need to change to const { createProxyMiddleware } = require("http-proxy-middleware"); |
1 reply
Answer selected by
JoshClose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you use the last version, you need to change to
const { createProxyMiddleware } = require("http-proxy-middleware");