简体   繁体   中英

The application that we get using create-react-app can be called a node.js application?

I want to understand that whether we should call the ReactJS application that we get after using create-react-app a "NodeJS application" or not, because just like a NodeJS application, ReactJS application also runs on a port in our computer system and also has package.json file. Can somebody please help me understand this?

The server deployed in case of the Reactjs app is static web-server. Which means it only serves built static files(html,css,js). It serves the static files to the browser on request and does not give any other type of response( like json).

The server deployed in case of Nodejs is a dynamic web-server ie it consists of static files plus some extra software(application server and database) and capable of responding with different forms of data(html files, json etc.).

A Reactjs app can be deployed easily and free of cost(on github, heroku etc.) as it only needs few resources as compared to Nodejs application.

The port you see on your computer being used is actually webpack-dev-server. create react app runs a small local webserver that (among other things) takes care of automatically reloading the react app when you change code.

React itself has no direct relation with NodeJS. It's just that the ecosystem that created "create-react-app" and provides all those other tools happens to be NodeJS.

React js is a front-end framework used for developing user interfaces while Node.js is a backend framework used for back-end API services. Hope you got the difference. U can use React with node.js as backend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM