summary refs log tree commit diff
path: root/serve.py
diff options
context:
space:
mode:
authordzwdz2023-05-25 21:54:37 +0200
committerdzwdz2023-05-25 21:54:37 +0200
commita0a4920deaf4ca645cdfee45edf00e614369882f (patch)
tree6dc02a9f563769f02d1f70976ed18c230aca6f81 /serve.py
initial commit
Diffstat (limited to 'serve.py')
-rw-r--r--serve.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/serve.py b/serve.py
new file mode 100644
index 0000000..3a43cc4
--- /dev/null
+++ b/serve.py
@@ -0,0 +1,12 @@
+from http.server import *
+import os
+import subprocess
+
+class MyHandler(SimpleHTTPRequestHandler):
+	def send_head(self):
+		path = self.translate_path(self.path)
+		path = os.path.relpath(path)
+		subprocess.run(["make", path])
+		return super().send_head()
+
+HTTPServer(("localhost", 8080), MyHandler).serve_forever()