Search code examples
herokudeploymentweb-deploymentreact-fullstack

Deploy full-stack app with Heroku - Express back end, React front end?


I built my first full-stack app, with an Express back end and React front end, contained in the same project folder (see GitHub repo). The front end is contained in a folder called client. I deployed the app from the root directory -- on the deployed site, it just says "Cannot GET /." The package.json in the front end portion has a proxy field that proxies requests to the back end. When I open the project on localhost, everything works correctly. Any pointers would be greatly appreciated.


Solution

  •  "scripts": {
        "start": "node server",
        "heroku-postbuild": "cd client && npm install && npm run build"
      },
    

    Try that fix in your backend package.json part. First, you want to get the backend set and then Heroku needs React to run. Heroku has some quirks to it.