Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 2.19 KB

README.md

File metadata and controls

74 lines (57 loc) · 2.19 KB

HTTP Expose 🌐

To expose a folder ./example on htttp://localhost:8000

$ expose ./example --port=8000

And now your directory is accessible ↴

$ curl http://localhost:8000/my/file.txt
this is my file content!

And for more, see usage 🚀

What's that?

HTTP Expose is a very simple and lightweight static HTTP server. It can be used to expose a provided directory to the internet through HTTP. 🧙‍♂️ The exposed directory will handle range request, caching and gzipping.

It can also be used programmmatically to do exactly the exact same thing 💻

Features

  • HTTP range request
  • HTTP caching
  • CORS
  • Gzip
  • Usable in command line, and programatically
  • Can list a directory content to facilitate navigation while debugging
  • Simple to use & configure

Lib usage

TODO ⚠️

Command line usage

Start with installing ↴

$ npm install -g http-expose

List of available arguments ↴

$ expose -h

Usage: http-expose <directory> [options]

Positionals:
  directory  Directory to expose                                        [string]

Options:
      --version            Show version number                         [boolean]
  -h, --help               Show help                                   [boolean]
  -p, --port               HTTP port                      [number] [default: 80]
      --host               HTTP host             [string] [default: "localhost"]
      --listdir            List directory content     [boolean] [default: false]
      --nocache            Disable caching            [boolean] [default: false]
      --cors-allow-origin  Cors allow origin setting     [string] [default: "*"]
      --verbose            Verbose                    [boolean] [default: false]