React/Spring Boot application API call is returning .jsx from the frontend instead of the expected data

I am using a decoupled React / Spring Boot application deployed on a single DigitalOcean Droplet. The application file structure is separated into a “backend” and “frontend” folder but it is all in the same repo. I was told that this is possible but it seems like my API calls are going to the frontend only for some reason.

I have the following API call in my frontend that is meant to return a list of services provided

const [ services, setServices ] = useState([]);

useEffect(() => {
    axios.get('https://my_application_domain/api/packages/load')
      .then(response => {
        if (response.status === 200) {
          const sortedServices = response.data.sort((a, b) => a.price - b.price);
          setServices(sortedServices);
        } else
          console.log("nope")
      })
      .catch(error => console.error(error));
  }, [])

Please forgive my poor error handling. I just wanted to get something working. I will refactor later.

The issue is occurring with all of my API calls but since they are all very similar, I expect the issue is in the URL itself rather than some other aspect of the function
This API call used to have localhost:8080 instead of my domain but i changed it over after deployment. when i enter that URL in to my browser, i get a blank page as if I used a malformed <Route /> in my App.jsx it has a navbar and footer but no content. I tried logging the response which output .jsx instead of the expected data.

It would seem that my API is not hitting the backend and is instead hitting the frontend and returning .jsx but I’m not sure where to go to fix it. My only idea is that I need to configure DigitalOcean differently to account for the ports but I have never deployed a site before and I can’t find a tutorial that is using the same stack as I am.

I’ve tried following about 6 different YT tutorials and searched SO for the solution but I keep getting stuck on one part or another. I would love to be able to say where exactly I got stuck but I got so frustrated with it that I set it all aside for a couple days and I no longer remember.