I have an app that needs to check with a backend API before rendering 404. The routing flow works something like this:

Request comes in to /{INCOMING\_PATH}, and the application attempts to fetch and render data from api.com/pages/{INCOMING\_PATH}.

If the API returns 404, then the app should return 404. If not, the data is rendered.

I'm not sold on using for this use case. {INCOMING\_PATH} will be dynamic, potentially with slashes and extensions in the path. Is this possible to implement in React Router (with proper SSR behavior too)? If so, how should I proceed?

([This question was originally posted on github](https://github.com/rackt/react-router/issues/2827) by another user. They were requested to post it here as it is a support request. But it doesn't seem they did. I am now stuck on exactly the same issue.)