A simple 0 Configuration command line HTTP server-http-server (nodeJs)

Source: Internet
Author: User

Http-server is a simple 0 configuration command line HTTP server, based on NodeJs.

If you don't want to write NodeJs Web-server.js repeatedly, you can use this.

installation (Global install plus-G):

  

Use :

Open command line input in the site Directory

Node Http-server

  

Used in Package.json

"Scripts": {     "start": "Http-server-a 0.0.0.0-p 8000",}

Parameters :

-p port Number (default 8080)-a IP address (default 0.0.0.0)-D Display directory list (default ' true ')-i display AutoIndex (default ' true ')- E or--ext If no default file extension is provided (default ' HTML ')-S or--silent suppress log information output --cors enable cors via the access-control-allow-< C6>origin Header-o Open Browser -H or--HelpPrint List and exit  for seconds (defaults to ' 3600 ') after starting service. Disable caching, then use-c-1.

Reference url:a Simple zero-configuration command-line HTTP server

A simple 0 configuration command line HTTP server-http-server (nodeJs)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.