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

is there any way that allow prender middleware return pages of specific routes ? #172

Open
VienNguyen113 opened this issue Mar 14, 2019 · 7 comments

Comments

@VienNguyen113
Copy link

No description provided.

@VienNguyen113 VienNguyen113 changed the title is there any way that alow prender middleware return pages of specific routes is there any way that allow prender middleware return pages of specific routes ? Mar 14, 2019
@thoop
Copy link
Contributor

thoop commented Mar 28, 2019

Could you give an example? You can use the whitelist and blacklist as seen on the readme to only allow specific routes to be sent to Prerender.

@VienNguyen113
Copy link
Author

VienNguyen113 commented Mar 28, 2019

@thoop yeah! i'used spliting code in my app! it's mean the Js file that represent for a route just downloaded to excute if only the user vistit that route! example: Home.js file will be downloaded if user visit my-app/home, the problem is come from here, i saw the middleware just return the js file of the master route.<Route path="/" component={MasterPage}/> <Route path="/home" component={HomePage}/>

@thoop
Copy link
Contributor

thoop commented Mar 28, 2019

I'm not sure what you mean. If a crawler accesses the root "/" URL then Prerender would render the root "/" URL. If a crawler accessed the "/home" URL then Prerender would render the "/home" URL.

Are you seeing something else happening?

@VienNguyen113
Copy link
Author

VienNguyen113 commented Mar 28, 2019

/home and not thing responded! i think because my serve just serve the route "/" and the return the index.html at this route! so if crawler visit the route /home, nothing will be responed

@thoop
Copy link
Contributor

thoop commented Mar 28, 2019

As long as the prerender-node middleware is running before you serve back your index.html page, then everything should work properly. Do you have an upstream server like nginx/apache that is modifying the URL to just the "/" route before sending it to your node server?

@VienNguyen113
Copy link
Author

oh! i did'nt use a webserver yet! i just set-up a pre-render server and an express server with the middleware

@thoop
Copy link
Contributor

thoop commented Mar 28, 2019

That should be fine then. Can you post your express configuration with any private information removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants