food-lookup-demo | A demonstration of using ` create-react-app ` with a server | Frontend Framework library
kandi X-RAY | food-lookup-demo Summary
kandi X-RAY | food-lookup-demo Summary
create-react-app configures a Webpack development server to run on localhost:3000. This development server will bundle all static assets located under client/src/. All requests to localhost:3000 will serve client/index.html which will include Webpack's bundle.js. To prevent any issues with CORS, the user's browser will communicate exclusively with the Webpack development server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse file information .
- commits all files in the source
- Create a new repo
- Check response status
- Initialize the repository
- Set configuration options
- setup repo
- Performs a search
- Create a release branch
- push changes to remote
food-lookup-demo Key Features
food-lookup-demo Examples and Code Snippets
Community Discussions
Trending Discussions on food-lookup-demo
QUESTION
My issue here is incredibly similar if not exactly the same as the one outlined in this issue. Unfortunately, I haven't been able to resolve it using the strategy it provides. So here are my own details:
I am using Create React App, React Router 4, Express, and Heroku and have followed the instructions here with regards to setting up a server with CRA.
Locally, I am able to access routes such as myapp/about
, yet after building and pushing to heroku, these 404.
I can navigate to this route via the UI (i.e. by clicking on a menu item that pushes a route onto history
), yet am unable to navigate to this route using only my browser's address bar. Furthermore, when I navigate using the UI, I'm not seeing any network activity related to the route such as an /about
request. Yet when I change the address bar and hit enter, this yields a network request to said route.
Here are some select snippets from my code:
app.js
...ANSWER
Answered 2017-Jun-25 at 18:33Alrighty, I figured this out.
All I needed was to ensure that any request not relevant for my internal API, such as a GET
request via the address bar, is routed directly to my index.html
file which handles the dynamic routing via React Router. Seems obvious enough now.
Here is the final route in my app.js
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install food-lookup-demo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page