Basic utility to launch a python 2 or python 3 simple http server.
#!/usr/bin/env bash
if [ "$1" != "" ]; then
PORT="$1"
elif [ "$PORT" = "" ]; then
PORT=8000
fi
echo "http://localhost:$PORT/"
VERSION=$(python --version)
if [ "${VERSION:7:1}" = "3" ]; then
python -m http.server $PORT
else
python -m SimpleHTTPServer $PORT
fi
Save it in /usr/local/bin/server
and chmod +x /usr/local/bin/server
With CORS enabled