Closed
Description
Steps to reproduce
npx create-react-app proxy-text
npm install http-proxy-middleware --save
- create setupProxy.js with contents
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://google.com',
changeOrigin: true,
}),
);
};
- add
useEffect
to App.js with fetch to `/api':
useEffect(() => {
fetch('/api?s="test')
}, [])
- start app, inspect network
The requested URL /api was not found on this server. That’s all we know.
Metadata
Metadata
Assignees
Labels
No labels