cloudflare / templates

A collection of starter templates and examples for Cloudflare Workers and Pages
https://cloudflareworkers.com
MIT License
999 stars 632 forks source link

Worker routing problem on react app #56

Closed mohamedrajhi closed 1 year ago

mohamedrajhi commented 4 years ago

Hello , I have an issue with the routing in my application after deploying it to cloudflare. The navigation using the navbar works , but if I copy/paste the same link that works with the navbar navigation i got this error.

Note : in the localhost everything is fine image

kristianfreeman commented 4 years ago

hey @mohamedrajhi, based on the screenshot, it looks like you're using workers sites to deploy your app. for react applications, you should go into your worker (workers-site/index.js) and update the code to use the serveSinglePageApp function. more docs here:

https://github.com/cloudflare/kv-asset-handler#servesinglepageapp

lauragift21 commented 1 year ago

Closing as issue was resolved!