Skip to content

Commit

Permalink
Minor change to highlight dev proxy behaviour (#3075)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjb authored and Timer committed Sep 29, 2017
1 parent a34701b commit 8c8bbca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ To tell the development server to proxy any unknown requests to your API server
"proxy": "http://localhost:4000",
```

This way, when you `fetch('/api/todos')` in development, the development server will recognize that it’s not a static asset, and will proxy your request to `http://localhost:4000/api/todos` as a fallback. The development server will only attempt to send requests without a `text/html` accept header to the proxy.
This way, when you `fetch('/api/todos')` in development, the development server will recognize that it’s not a static asset, and will proxy your request to `http://localhost:4000/api/todos` as a fallback. The development server will **only** attempt to send requests without `text/html` in its `Accept` header to the proxy.

Conveniently, this avoids [CORS issues](http://stackoverflow.com/questions/21854516/understanding-ajax-cors-and-security-considerations) and error messages like this in development:

Expand Down

0 comments on commit 8c8bbca

Please sign in to comment.