A command line tool to serve local directory with http protocol
# Install globally:
npm i instantly_http -g
instant_http --help
Usage: instant_http [global options]
Options:
-V, --version output the version number
-p --port [port] To point which port to use as the server address. (default: "9090")
-d --dir [dir] Dir to serve (default: "/home/frank/code/InstantHttp")
-pt --proxyTarget [proxyTarget] Where the delegated communication targets to
-pp --proxyPattern [proxyPattern] URL matcher to be used to identify which url to proxy
-o --open [open] Whether to open chrome automatically (default: false)
-m --mode [mode] Which mode to use (default: "NORMAL")
-i --indexFile [indexFile] Index File location(relative to --dir) (default: "index.html")
-q --quiet [quiet] Set it to false to see more debug outputs (default: false)
-h, --help display help for command
import {run} from 'instantly_http';
const {run} = require('instantly_http');
./instantHttp --open=false --port=8080 --proxyTarget=http://google.com --proxyPattern=/proxy
After checkout then install this repository, you can then try below commands to get an executable binary.
npm run build-binary
pkg is used as the package utility, please check pkg's document in order to build runnable binaries as you want.
npm run test