Basic use of http-server


npm install http-server -g


  1. By the terminal enters the destination folder , then enter in a terminal http-serverif you see the following interface, it shows the success of the launch, we can access an address by any of
    Insert picture description here
  2. After accessing the address, the index.html file will be opened by default. If there is no index.html file in the target folder, an index will be opened. At this time, you need to manually click the xxx file to open it.

How to close

ctrl + c


Guess you like