A
A
Alexey Kostyukhin2020-04-19 00:59:09
Node.js
Alexey Kostyukhin, 2020-04-19 00:59:09

Why do we build in create-react-app?

Good evening, this is not a very smart question:
Recently I have been writing projects in react'e. The whole assembly boils down to installing create-react-app. It installs all the dependencies and configures the server for us, as a result we have a ready-made server that can be run on port 3000. It's all clear The

question is the following. The official documentation says that after we have done the work, we need to prepare our project for "Production" this is done by the script npm build command (something like this)
So. And what, in fact, is in the build folder?
how will a back-end programmer upload my project to the back-end? Interested, for example, in expressJS.
I tried to put it, raise it, make JSON with data. But I didn’t understand how I would upload my react project to express js. How will the build folder make my task easier?
PS I'm not talking about subtle technical issues. They would explain to me in general how and what happens on the expressjs server, how the merging takes place in general.
P.s.s why exactly the build folder should get into the server?
I WOULD BE VERY GRATEFUL FOR ANSWERS!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-04-19
@aleksey4uk

why does the build folder have to go to the server?

because there are stupid index.html + css + js that will be opened by the browser, unlike the source folders where there are a billion component files and other rubbish
I will upload my react project to express js

not
  • the server will run node which will run express
  • express will distribute index.html to user browsers from the assembled (build) react application, which will be in its own separate folder
  • users will access the application, it will talk to express

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question