create-react-app-lambda icon indicating copy to clipboard operation
create-react-app-lambda copied to clipboard

useProxy.js not working - new code provided

Open svdoever opened this issue 4 years ago • 0 comments

Please use the following code:

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(createProxyMiddleware('/.netlify/functions/', {
    target: 'http://localhost:9000/',
    "pathRewrite": {
      "^/\\.netlify/functions": ""
    }
  }));
};

svdoever avatar May 23 '21 17:05 svdoever