F
F
FLighter2018-12-16 14:16:18
Node.js
FLighter, 2018-12-16 14:16:18

Do you need to build the server side on node.js?

Good day!
I work mainly with the front, I almost didn’t touch the server part, but now there is a need to write. Express.js and forward, but the question arose: if a bundle is assembled during the assembly of the front, optimizations, minifications, etc. are performed, is it necessary to do something similar for the server (if so, what?)? Or do I write production code right away?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2018-12-16
@flighter7

What for? The V8 engine (or whatever the node is currently running on) compiles all these scripts anyway at startup. At the front, the bundle is assembled for the reason that each visitor, when opening the site, downloads a copy of this bundle, because in order not to drive more traffic over the network a million times (and it was loaded faster on mobile phones), it is compressed to a minimum volume and transmitted already in a reduced form. While on the server side, there is no need to move the sources back and forth, they are read from disk only once - when the node itself is launched. If you restarted the node a million times a day, and your scripts were physically lying on a floppy connected to the server, then there might still be some sense and it was from reducing their volume, but no.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question