aboutsummaryrefslogtreecommitdiff
path: root/share/templater/http_server/files/Makefile.http_server
blob: c3d0ab396a1f339481e2a676e37af90e060791c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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