react-express-starter icon indicating copy to clipboard operation
react-express-starter copied to clipboard

Proxy error

Open marcosmol204 opened this issue 3 years ago • 5 comments

Hi, I have the next issue when I press submit with some input. WhatsApp Image 2021-05-01 at 10 55 31

My workstation: -Windows 10 -Node v15.0.0 -Npm 7.10.0

Do you know what could be the problem ?

marcosmol204 avatar May 01 '21 08:05 marcosmol204

How are you running the application?

philnash avatar May 01 '21 08:05 philnash

npm run dev

marcosmol204 avatar May 01 '21 10:05 marcosmol204

Did you create an .env file? Without an .env file, even a blank one, the server will fail to start. But in the terminal the React application will take over and appear to be working.

philnash avatar May 02 '21 23:05 philnash

Worked! What would you change for deployment ?

‫בתאריך יום ב׳, 3 במאי 2021 ב-2:38 מאת ‪Phil Nash‬‏ <‪ @.***‬‏>:‬

Did you create an .env file? Without an .env file, even a blank one, the server will fail to start. But in the terminal the React application will take over and appear to be working.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philnash/react-express-starter/issues/22#issuecomment-830926790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2ASRBSIMKDQAUMPR6OIV3TLXO57ANCNFSM436CSXAQ .

marcosmol204 avatar May 03 '21 16:05 marcosmol204

Deploying can be done in so many ways it's hard to give good advice without being prescriptive about the environment you want to deploy to. However, the npm run dev command is very much only a command you should run for development.

When it comes to deploying, you will want to build the React application into a static output and host that somewhere. The server side of it could be run with just node server but that is not fault tolerant in a basic hosting environment.

I have another project that is based off this repo and I made some changes that would make it deployable to Heroku, which you can see here with instructions once you've made those changes here.

Let me know if that helps.

philnash avatar May 04 '21 02:05 philnash