Closed richb-hanover closed 8 years ago
Update: I see you have updated the article. Thanks.
But I really would like an explanation of how the proxy...
works - I don't see anything in the code that's specific to /api/**
... Thanks again.
Update ^2: I had trouble - the proxying wasn't working. But... I just noticed that you upgraded client/package.json to create-react-app 0.2.3
, which specifically adds the proxying capability (see https://github.com/facebookincubator/create-react-app/releases/tag/v0.2.3)
And the hint that I was looking for re: proxying... The webpack dev server will send all unknown requests to the named proxy server. See https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#proxying-api-requests-in-development
@richb-hanover Looks like I have to re-visit my GH notifications! Thanks for your patience
On the other hand, I really liked the description of noticing the CORS problem, diagnosing it, and then handling it with the allowCrossDomain() middleware in the original article. Perhaps a new article?
Perhaps! We might cover this when we add an article on deploying this setup.
The sqlite database with the nutrition data is fun. Where did you get the data? Is it accurate?
USDA National Nutrient Database.
Your original article mentioned a follow-on article on deploying to S3. Is this still in the works? (And will that have CORS problems?)
Yeah, expect to see this addition soon. CORS might be an issue, depending on the route you take.
Feel free to re-open if more questions have emerged in the interim
Thanks for this project. I love the clear way the project shows how to graft a server onto create-react-app.
"proxy": "http://localhost:3001/"
to the client's package.json file. Will you update the article at https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/ to reflect this? It would be great to have a brief description of how theproxy
works, as well...allowCrossDomain()
middleware in the original article. Perhaps a new article?Many thanks!