Failed to load resource: the server responded with a status of 404 () after deploying on Netlify

I am trying to deploy a MERN stack application through the use of Heroku(backend) and Netlify(frontend). After building and deploying the site with the help of Netlify, I got the error specified in the topic. I have been looking at other posts but I cant seem to resolve it.

site url: https://radiant-scone-994cb7.netlify.app](https://radiant-scone-994cb7.netlify.app/

below is my build logs:

11:04:13 PM: build-image version: 9495be345de05eb8e91837e5d92c5afd0dbd65f6 (focal)
11:04:13 PM: buildbot version: 9495be345de05eb8e91837e5d92c5afd0dbd65f6
11:04:13 PM: Fetching cached dependencies
11:04:13 PM: Starting to download cache of 157.5MB
11:04:14 PM: Finished downloading cache in 444ms
11:04:14 PM: Starting to extract cache
11:04:16 PM: Finished extracting cache in 1.602s
11:04:16 PM: Finished fetching cache in 2.169s
11:04:16 PM: Starting to prepare the repo for build
11:04:16 PM: Preparing Git Reference refs/heads/main
11:04:17 PM: Parsing package.json dependencies
11:04:18 PM: Starting build script
11:04:18 PM: Installing dependencies
11:04:18 PM: Python version set to 2.7
11:04:18 PM: Started restoring cached Node.js version
11:04:19 PM: Finished restoring cached Node.js version
11:04:19 PM: v16.19.0 is already installed.
11:04:19 PM: Now using node v16.19.0 (npm v8.19.3)
11:04:19 PM: Enabling Node.js Corepack
11:04:20 PM: Started restoring cached build plugins
11:04:20 PM: Finished restoring cached build plugins
11:04:20 PM: Attempting Ruby version 2.7.2, read from environment
11:04:20 PM: Using Ruby version 2.7.2
11:04:20 PM: Using PHP version 8.0
11:04:20 PM: Started restoring cached corepack dependencies
11:04:20 PM: Finished restoring cached corepack dependencies
11:04:20 PM: No npm workspaces detected
11:04:20 PM: Started restoring cached node modules
11:04:21 PM: Finished restoring cached node modules
11:04:21 PM: Bypassing sha validation. Running pre & post install scripts
11:04:21 PM: Installing npm packages using npm version 8.19.3
11:04:23 PM: up to date, audited 1468 packages in 2s
11:04:23 PM: 225 packages are looking for funding
11:04:23 PM:   run `npm fund` for details
11:04:23 PM: 8 high severity vulnerabilities
11:04:23 PM: To address issues that do not require attention, run:
11:04:23 PM:   npm audit fix
11:04:23 PM: To address all issues (including breaking changes), run:
11:04:23 PM:   npm audit fix --force
11:04:23 PM: Run `npm audit` for details.
11:04:23 PM: npm packages installed
11:04:23 PM: Started restoring cached go cache
11:04:23 PM: Finished restoring cached go cache
11:04:24 PM: go version go1.19.5 linux/amd64
11:04:24 PM: Detected 1 framework(s)
11:04:24 PM: "create-react-app" at version "5.0.1"
11:04:24 PM: Installing missing commands
11:04:24 PM: Verify run directory
11:04:24 PM: Section completed: initializing
11:04:25 PM: ​
11:04:25 PM:   Netlify Build                                                 
11:04:25 PM: ────────────────────────────────────────────────────────────────
11:04:25 PM: ​
11:04:25 PM: ❯ Version
11:04:25 PM:   @netlify/build 29.5.4
11:04:25 PM: ​
11:04:25 PM: ❯ Flags
11:04:25 PM:   baseRelDir: true
11:04:25 PM:   buildId: 63e8ffe50a88550008ba7b00
11:04:25 PM:   deployId: 63e8ffe50a88550008ba7b02
11:04:25 PM: ​
11:04:25 PM: ❯ Current directory
11:04:25 PM:   /opt/build/repo
11:04:25 PM: ​
11:04:25 PM: ❯ Config file
11:04:25 PM:   No config file was defined: using default values.
11:04:25 PM: ​
11:04:25 PM: ❯ Context
11:04:25 PM:   production
11:04:25 PM: ​
11:04:25 PM:   1. Build command from Netlify app                             
11:04:25 PM: ────────────────────────────────────────────────────────────────
11:04:25 PM: ​
11:04:25 PM: $ npm run build
11:04:25 PM: > frontend@0.1.0 build
11:04:25 PM: > react-scripts build
11:04:26 PM: Creating an optimized production build...
11:04:31 PM: Compiled successfully.
11:04:31 PM: 
11:04:31 PM: File sizes after gzip:
11:04:31 PM:   61.64 kB  build/static/js/main.f6e17550.js
11:04:31 PM:   763 B     build/static/css/main.45b7182b.css
11:04:31 PM: The project was built assuming it is hosted at /.
11:04:31 PM: Starting post processing
11:04:31 PM: You can control this with the homepage field in your package.json.
11:04:31 PM: The build folder is ready to be deployed.
11:04:31 PM: You may serve it with a static server:
11:04:31 PM:   npm install -g serve
11:04:31 PM: Post processing - HTML
11:04:31 PM:   serve -s build
11:04:31 PM: Find out more about deployment here:
11:04:31 PM:   https://cra.link/deployment
11:04:31 PM: Post processing - header rules
11:04:31 PM: ​
11:04:31 PM: (build.command completed in 5.9s)
11:04:31 PM: ​
11:04:31 PM:   2. Deploy site                                                
11:04:32 PM: Post processing - redirect rules
11:04:31 PM: ────────────────────────────────────────────────────────────────
11:04:31 PM: ​
11:04:31 PM: Starting to deploy site from 'build'
11:04:31 PM: Calculating files to upload
11:04:32 PM: Post processing done
11:04:31 PM: 0 new files to upload
11:04:31 PM: 0 new functions to upload
11:04:32 PM: Section completed: postprocessing
11:04:31 PM: Section completed: deploying
11:04:31 PM: Site deploy was successfully initiated
11:04:31 PM: ​
11:04:31 PM: (Deploy site completed in 73ms)
11:04:31 PM: ​
11:04:31 PM:   Netlify Build Complete                                        
11:04:31 PM: ────────────────────────────────────────────────────────────────
11:04:31 PM: ​
11:04:31 PM: (Netlify Build completed in 6s)
11:04:31 PM: Caching artifacts
11:04:31 PM: Started saving node modules
11:04:31 PM: Finished saving node modules
11:04:31 PM: Started saving build plugins
11:04:31 PM: Finished saving build plugins
11:04:31 PM: Started saving corepack cache
11:04:32 PM: Site is live ✨
11:04:31 PM: Finished saving corepack cache
11:04:31 PM: Started saving pip cache
11:04:31 PM: Finished saving pip cache
11:04:31 PM: Started saving emacs cask dependencies
11:04:31 PM: Finished saving emacs cask dependencies
11:04:31 PM: Started saving maven dependencies
11:04:32 PM: Finished saving maven dependencies
11:04:32 PM: Started saving boot dependencies
11:04:32 PM: Finished saving boot dependencies
11:04:32 PM: Started saving rust rustup cache
11:04:32 PM: Finished saving rust rustup cache
11:04:32 PM: Started saving go dependencies
11:04:32 PM: Finished saving go dependencies
11:04:32 PM: Build script success
11:04:32 PM: Section completed: building
11:04:33 PM: Uploading Cache of size 157.5MB
11:04:34 PM: Section completed: cleanup
11:04:34 PM: Finished processing build request in 20.481s

package.json

{
  "proxy": "http://netninja-workouts-app.herokuapp.com",
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "date-fns": "^2.29.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.4.3",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

You’re accessing your backend on /api. Heroku doesn’t answer to your requests on Netlify. You need to either call the API URL directly, or setup Netlify Rewrites: Rewrites and proxies | Netlify Docs