# # HTTP Server Makefile - https://templater.fluxo.info # # Port to serve content HTTP_PORT="8000" HTTP_SERVER="http.server" # Base to serve the content HTTP_BASE="." # See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200 # http://php.net/manual/en/features.commandline.webserver.php serve: @if [ "$(HTTP_SERVER)" = "SimpleHTTPServer" ]; then cd $(HTTP_BASE) && python -m SimpleHTTPServer $(HTTP_PORT); fi @if [ "$(HTTP_SERVER)" = "ssi_server" ]; then cd $(HTTP_BASE) && PYTHONDONTWRITEBYTECODE=0 ssi_server.py $(HTTP_PORT); fi @if [ "$(HTTP_SERVER)" = "http.server" ]; then cd $(HTTP_BASE) && python3 -m http.server $(HTTP_PORT); fi @if [ "$(HTTP_SERVER)" = "php" ]; then cd $(HTTP_BASE) && php -S localhost:$(HTTP_PORT); fi