diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-07-05 18:58:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-07-05 18:58:03 -0300 |
commit | f160642b16c5da9c60d6004defc14f2afc95aa62 (patch) | |
tree | dfb7c2d0455893f2816cb3557cf89406483d5e1d /share/templater/http_server/files/Makefile.http_server | |
parent | 9da19c8d2612fc09eb58c9604fe069c1fb2d6552 (diff) | |
download | templater-f160642b16c5da9c60d6004defc14f2afc95aa62.tar.gz templater-f160642b16c5da9c60d6004defc14f2afc95aa62.tar.bz2 |
Diffstat (limited to 'share/templater/http_server/files/Makefile.http_server')
-rw-r--r-- | share/templater/http_server/files/Makefile.http_server | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/share/templater/http_server/files/Makefile.http_server b/share/templater/http_server/files/Makefile.http_server new file mode 100644 index 0000000..c3d0ab3 --- /dev/null +++ b/share/templater/http_server/files/Makefile.http_server @@ -0,0 +1,18 @@ +# +# 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 |