Having backend and frontend on same domain

Hello. I have a react.js frontend hosted on a render static site and a python flask backend hosted on a render web service. I had everything working as I wanted but I just could not get the session management and CORS to work with Safari browsers.

I have slightly given up and hoped to just have a single domain point to both frontend and backend (so no CORS, yay!)

e.g. example dot com → frontend
example dot com/api → backend

Is there a way I can set this up simply in Render? Adding a custom domain didn’t allow me to set the /api/* to direct to the backend.

Since you’re using a static site here then you can setup a rewrite rule for /api to your backend service.