Dynamic HTTP Routes for CRA (using react router dom)

Posted April 21, 2021 545 views
ReactDigitalOcean App Platform


I just deployed my react app with digital ocean. I’m wondering how to add dynamic routes to my HTTP routes.

Currently I’m trying the following YAML configuration but it is not working.

  - path: /
  - path: /dashboard
  - path: /invoice
  - path: /patient
  - path: /profile
  - path: /patient/[id]

How can I add a dynamic route for (example):

Am I missing something?


edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello @wmFish ,

Unfortunately, dynamic routing is not supported in the App Platform as of now. As a workaround, you can set the catchall settings to index.html file. There are 2 methods to set the catchalldocument.


1) Using Cloud panel UI: Log in and click on App > Settings >> click on component name > scroll down to Custom page > Edit Custom page and select Catchall > Enter index.html in the page name block > save

2) Using App Spec:
You can the catchall_document to index.html in-app spec.

Here’s the documentation link which will help you in updating your app:


A similar discussion can be found in our community channel as well.

Regarding dynamic routing, I encourage you to share your thoughts about this on our ideas page:

Hope this helps!

Sri Charan