D
D
Drovosek012019-05-26 12:41:02
Node.js
Drovosek01, 2019-05-26 12:41:02

What is the difference between live-server and http-server?

When I asked myself the question of running SPA Angular on a computer.
I googled that the easiest way to run the compiled version is with some kind of server. I figured out that this can be done with live-server or http-server or lite-server and it seems like with webpack-dev-server
I read and understood that lite-server is a wrapper over browsersync . Browsersync can track file changes and update the browser at the same time, and lite-server can still redirect requests to index.html, which is just vital for the normal operation of the SPA (at least for an Angular application with PathLocationStrategy).
As I understand it, webpack-dev-server is essentially the same browsersync that works right after the files are built.
I read the readme live-server and http-server and it seemed to me that these are almost clones, which differ only in the name of the arguments passed during startup.
Can anyone explain what is the difference between them and why did live-server appear if there was already an http-server before it (judging by the version history of these packages on npmjs)?
PS
To the question "which one is better to use", I think the answer is http-server, because it is updated more often, which means bugs are fixed more often, right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-05-26
@Drovosek01

http-server- just http server, a minimum of superfluous. Takes files and sends them at the request of the browser. An analogue of apache, nginx, simply simplified, on a node. Convenient for quickly opening the contents of a folder in a browser.
All of the above is for development purposes only. http-server can still be added to a combat project, but why, if there is nginx.
Almost any language for the backend has similar servers now.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question