fullstackreact / food-lookup-demo

A demonstration of using `create-react-app` with a server
MIT License
1.19k stars 373 forks source link

Great project! A couple questions... #5

Closed richb-hanover closed 8 years ago

richb-hanover commented 8 years ago

Thanks for this project. I love the clear way the project shows how to graft a server onto create-react-app.

Many thanks!

richb-hanover commented 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.

richb-hanover commented 8 years ago

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

acco commented 8 years ago

@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