erikras / erikras/react-redux-universal-hot-example

Dont Work Http Proxy

Open
#1,374 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

```
const targetUrl = config.apiHost + config.apiPort;
const proxy = httpProxy.createProxyServer({ target: targetUrl });
// Proxy to API server app.use('/api', (req, res) => {
console.log(req.originalUrl);
console.log(targetUrl);
proxy.web(req, res, {target: targetUrl});
});
```

Why http proxy send a request to the right address, and receives 404, and if you open the same address through brouser gets json.
checked through console.log the issue the required address

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.