Simple Go file server for command line development use, a la Python's SimpleHTTPServer.
go get -u github.com/fogleman/serve
By default, serves the current working directory on port 8000. If $GOPATH/bin
is on your PATH
, you can run it anywhere.
$ serve
Flag | Default | Description |
---|---|---|
-port | 8000 |
port to listen on |
-dir | "." |
directory to serve |
-cors | false |
true to enable CORS (via Access-Control-Allow-Origin: * ) |