📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

http-server

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
h

http-server

A simple zero-configuration command-line http server

14.1.1
latest
98

Supply Chain Security

100

Vulnerability

100

Quality

81

Maintenance

100

License

Network access

Supply chain risk

This module accesses the network.

Found 2 instances in 1 package

Dependencies have 8 high alerts.

Socket optimized override available

Version published
Weekly downloads
3.2M
12.9%
Maintainers
3
Weekly downloads
 
Created
Issues
142

What is http-server?

The http-server npm package is a simple, zero-configuration command-line HTTP server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.

What are http-server's main functionalities?

Serving static files

This command serves the current directory at localhost:8080. It can be used to view static websites or any static files.

http-server -p 8080

Customizable port

This command serves the current directory on a specified port, in this case, port 3000.

http-server -p 3000

Specify the directory to serve

This command serves the specified directory instead of the current directory.

http-server /path/to/directory

HTTPS support

This command serves the current directory over HTTPS using the specified certificate and key files.

http-server --ssl --cert path/to/cert.pem --key path/to/key.pem

Enable CORS

This command serves files with CORS enabled, allowing resources to be requested from another domain.

http-server -c-1 --cors

Other packages similar to http-server

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts