Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to stop index.js from overriding all other pages? #4452

Closed
evandrocoan opened this issue May 13, 2018 · 2 comments
Closed

How to stop index.js from overriding all other pages? #4452

evandrocoan opened this issue May 13, 2018 · 2 comments

Comments

@evandrocoan
Copy link

I ran it on 2 web servers, the first one is the standard used on the basic instructions:

npx create-react-app my-app
cd my-app
npm start
  1. First server:
    image

The second one, which also have the same behavior is Apache Tomcat 9. I put the ReactJS app there with:

npx create-react-app my-app
cd my-app
yarn build
mv build/* ../WebContent/app/
  1. Second server:
    image

How can it show the index.js page, even I type some other non-existing address as http://localhost:3000/asdfasdf%20/*asd/fasd?

Can it just show 404 not found?

@erichunzeker
Copy link

In React, page routing comes from the react-router class. You have to import that and render and declare the routes

@evandrocoan
Copy link
Author

Oops, Thanks. I will look into that.

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants