Pass proxy options using nested dotted objects. Proxies all requests which can't be resolved locally to the given url. To disable caching, use -c-1.Įnable logging of the client's IP address Set cache time (in seconds) for cache-control max-age header, e.g. Open browser window after starting the server. If gzip is also enabled, it will try to serve brotli first.Įnable CORS via the Access-Control-Allow-Origin header public/some-file.js when a brotli compressed version of the file exists and the request accepts br encoding. If brotli is also enabled, it will try to serve brotli first. public/some-file.js when a gzipped version of the file exists and the request accepts gzip encoding. Use -p 0 to look for an open port, starting at 8080. Add -c-1 as an option to disable caching. Globally via Homebrew brew install http-serverĪs a dependency in your npm package: npm install http-server This will install http-server globally so that it may be run from the command line anywhere. Globally via npm npm install -global http-server Using npx you can run the script without installing it first: npx 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. Http-server is a simple, zero-configuration command-line static HTTP server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |