0

I'm building a web app using React.js and Node.js. I wanted to know that how I deploy my web application on a server? Like when I run it on my local server then it needs two server, one is for React.js and another is for Node.js. Is it goes same with deployment also?

2 Answers 2

1

No, you will only need one server (unless you're using a server side rendering framework like Next.js). If you used create-react-app, use should be able to run npm build and it'll create a static build. Here's some relevant links:

Sign up to request clarification or add additional context in comments.

1 Comment

No Problem. Lemme know if you need more help
0

You need to run script to build and bundle your client side by calling npm run build in terminal, then you should serve those build files in index/main file in backend side . Then you can deploy your application. You can read this awesome article to understand in depth: https://www.freecodecamp.org/news/deploying-a-mern-application-using-mongodb-atlas-to-heroku/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.