1
0
mirror of https://git.fsfe.org/FSFE/fsfe-local-build.git synced 2026-04-20 11:23:06 +02:00

adding option to use python simplehttp webserver module which doesn't require users to install lighttpd

This commit is contained in:
2016-12-15 17:39:39 +01:00
parent 76a5a5bcd7
commit 121dbd003b
5 changed files with 58 additions and 10 deletions

15
pywebserver-fsfe.py Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env python3
import http.server
import socketserver
import os
import sys
WEB_DIR = sys.argv[1]
WEB_PORT = int(sys.argv[2])
os.chdir(WEB_DIR)
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", WEB_PORT), Handler)
httpd.serve_forever()