I have created this project where I need to get information from a server. I have used the createProxyMiddleware from http-proxy-middleware for many months in this project without any problem. But today it just stopped working and I din't change anything to the proxy.
Here is the code in the setupProxy.js file. The process.env.REACT_APP_GEOSERVER_MAPEO_API variable is a variable that contains the endpoint:
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
console.log("test");
app.use(
"/geoserver",
createProxyMiddleware({
target: process.env.REACT_APP_GEOSERVER_MAPEO_API,
changeOrigin: true,
})
);
};
I also added a console.log("test")
to see if the function gets executed but it never does.
I also have done a git checkout to a previous version of my code where I am certain the connection worked but also in those versions it doesn't work. So I am certain that i haven't changed any code which may influence the proxy.