1

how should my scripts look like if I want to deploy to Heroku ? and make sure the app is running in production mode (build), so basically I push my current code to github and deploy that pushed code from Heroku the problem is my app is running in dev mode and it totally ignores building the app for some reason any idea how to fix this issue?

"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
},

I also want my application to run in the EU region, but the mars/create-react-app buildpack sets my app location to USA.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Richardson
  • 1,804
  • 10
  • 38
  • 1
    Does this answer your question? [Heroku serving create-react-app development build instead of production](https://stackoverflow.com/questions/54680727/heroku-serving-create-react-app-development-build-instead-of-production) – ChrisGPT was on strike Jan 10 '22 at 20:35
  • 1
    Or, if your app is standalone, you can [use the `mars/create-react-app` buildpack](https://stackoverflow.com/a/70658535/354577). – ChrisGPT was on strike Jan 10 '22 at 20:37
  • 1
    Are you sure? I don't believe buildpacks are responsible for setting regions. You [can set it yourself when creating your app](https://devcenter.heroku.com/articles/regions#specifying-a-region), though: `heroku create --region eu`. In one go: `heroku create YOUR_APP_NAME --region eu --buildpack mars/create-react-app`. – ChrisGPT was on strike Jan 10 '22 at 22:48

1 Answers1

1

You can still use mars/create-react-app. Common runtime apps always default to the US region, no matter which buildpack you are using.

Use the --region argument when creating your app:

heroku create YOUR_APP_NAME --region eu

Then you can use mars/create-react-app as usual. If you want to set the buildpack at the time of app creation you can include the --buildpack flag:

heroku create YOUR_APP_NAME --region eu --buildpack mars/create-react-app
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257