aboutsummaryrefslogtreecommitdiff
path: root/Makefile.http_server
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2025-05-20 18:44:34 -0300
committerSilvio Rhatto <rhatto@riseup.net>2025-05-20 18:44:34 -0300
commit946dea4f6d153c04d31589c610141c96b0f39c12 (patch)
tree6a399e4eed46af042ed338015d85e931cfe1d8a5 /Makefile.http_server
parent8ec513e5b26f0043cb09ad4dc245076554c0fe47 (diff)
downloadslides-master.tar.gz
slides-master.tar.bz2
RestruturaçãoHEADmaster
Diffstat (limited to 'Makefile.http_server')
-rw-r--r--Makefile.http_server18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile.http_server b/Makefile.http_server
new file mode 100644
index 0000000..c3d0ab3
--- /dev/null
+++ b/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