AdamCodes716
AdamCodes716

Reputation: 301

Trying to set package.json for MERN app in Heroku

I am a bit new to this area and I I am missing something fundamental. I have a very basic shell of an application:

Client path: src/index.js

Server path: server/index.js

Procfile: web:node server/index.js

root package.json:

    "dev": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",

How do I tell heroku where the client files are? Do I need a "start" script in the root's package.json? From the examples that I've seen they usually had "node " to start the express server. Do I need to set up something like webpack for the client server?

Upvotes: 0

Views: 81

Answers (1)

AdamCodes716
AdamCodes716

Reputation: 301

Please ignore. I have done this in the past and got myself turned around by looking through various guides. It was a comedy of errors, starting with mistakenly having type:module in the package.json (I had created it elsewhere originally) and that put me down a rabbit hole of making the wrong decisions.

Upvotes: 1

Related Questions