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. Install (Global install plus-G): NPM Install Http-ser Ver use: Open command line in the Site Directory input node http-server used in Package.json"Scripts": {
"Start":"http-server-a 0.0.0.0-p 8000",
} parameter:-P port Number (default8080)

-A IP address (default0.0.0.0)

-D displays a list of directories (default'True')

-I display AutoIndex (default'True')

-E or--ext if the default file name extension is not provided (the default'HTML')

-S or--silent suppress log information output

--cors enable Cors via the Access-control-allow-origin header

-O Open the browser after starting the service

-H or--help print List and exit

-C Sets the cache time (seconds) for the Cache-control max-age header, e.g.-C10 forTenSeconds (defaults to'3600'). Disable caching, use-c-1.

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

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.