Skip to content

Options

Eric M. Dantas edited this page May 16, 2018 · 3 revisions

CLI

--port, --p                      change port
--host, --h                      change the host name
--secure, --s                    use https/wss
--http2, --h2                    use the new and improved version of the HTTP protocol
--cors, --c                      respond to requests with CORS headers, use true or object to override defaults
--quiet, --q                     no logging whatsoever
--noBrowser, --nb                won't open the browser automagically
--only, --o                      will only watch for changes in the given path/glob/regex/array
--ignore, --ign                  won't watch for changes in the given path (regex)
--pathIndex, --pi                change the path to your index.html
--proxy, --px                    uses proxy
--proxyTarget, --pxt             the http/https server where the proxy will "redirect"
--proxyWhen, --pxw               when the proxy should be activated; like --pxw /api/*
--root, --ro                     set the root to a different folder, like "./src/my/deep/folder/"
--watch, --w                     choose to watch for files change or not
--static, --st                   choose what paths are going to be served
--reloadDelay, --rd              time (in ms) to delay the browser refresh
--redirectHttpToHttps, --rhh     redirect any http traffic to https
--insecurePort, --insPort        inform an insecure port

Default values

--port                  is 1307
--host                  is 127.0.0.1
--secure                is false
--http2                 is false
--cors                  is false
--quiet                 is false
--only                  is ".", which means it'll watch everything
--ignore                see list full regex in lib/options.js
--noBrowser             is false, which means it'll always open the browser on start
--pathIndex             is "", which means it'll look for the index.html in the root
--proxy                 is false, which means it'll not look for another server to answer for the /api/, for example
--proxyTarget           is "", no server to be target
--proxyWhen             is "", and it's supposed to be set with something like /api/*
--root                  is process.cwd()
--watch                 is true
--static                is [root, root + "/path/to/your/index"]
--reloadDelay           is 0
--redirectHttpToHttps   is false
--insecurePort          is 80

.alivrc

All of the above

{
  "port": 1234,
  "host": "my-custom-host.io",
  // and on and on
}
Clone this wiki locally