macOS: brew install caddy
caddy --conf=<( echo -e ':8080\ntls self_signed' )
Make sure to use https://
, otherwise you'll download a.. download file. Since it's self signed, you'll need to ignore any security warnings in order to continue.
This alert be skipped in Chrome by either typing "badidea" when the alert is showing. This is a one off measure, restarting the server will trigger the alert again. It can be set permanently by checking the flag under chrome://flags/#allow-insecure-localhost
(requires a Chrome restart).
Props to @bgotink
macOS: brew cask install docker
docker run www -it -p "8080:80" -v "$(pwd)":/usr/local/apache2/htdocs/ httpd:2.4-alpine
Running it in the background:
WWW=$(docker run -dit -p "8080:80" -v "$(pwd)":/var/www/html lkwg82/h2o-http2-server)
To terminate, run docker attach $WWW
and hit Ctrl + C
.
python -m SimpleHTTPServer 8080
Serve another dir (this pattern applies to all other cmds of course):
pushd out/www; python -m SimpleHTTPServer 8080; popd
If you do not want to expose the assets to the entire network:
python -c 'import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer(("$(ipconfig getifaddr en0)", 8080), shs.SimpleHTTPRequestHandler).serve_forever()'
python -m http.server 8080
php -S localhost:8080