My Heroku app is using React with React Router. I use Switch to navigate through different components, so the URL changes as well (e.g. /room/4141
). However, if
That buildpack can be configured via a JSON file:
You can configure different options for your static application by writing a
static.json
in the root folder of your application.
One of the sample routing configurations looks like it does exactly what you want:
When serving a single page app, it's useful to support wildcard URLs that serves the index.html file, while also continuing to serve JS and CSS files correctly. Route ordering allows you to do both:
{ "routes": { "/assets/*": "/assets/", "/**": "index.html" } }