Hashnode/mern-starter

Problem with production mode in server

Closed this issue · 2 comments

After i build npm run build, i got dist folder with client and server.bundle.js

I copied dist folder to linux server, and configured nginx proxy to prot 8000,
Additionally included index.js file into dist folder

so finally run below command in server.
NODE=production node index.js

but, only html file is loading, .css and .jss file are getting 404 error.

What im missing?

How do i deploy to linod (Linux) server, continues integration and automation?

Got fixed by copy of index.js outside dist folder

Hi,

Did you deploy your app to AWS or any other cloud ?

I am following this tutorial https://medium.com/@Keithweaver_/setting-up-mern-stack-on-aws-ec2-6dc599be4737 and trying to deploy. But I am stuck at this step pm2 start server.js -- --production.

It is throwing error without any description. Can you please give a link / tutorial / explain briefly of how you deployed your app ? It will be really helpful.

Thanks,