blob: 3a43cc4bb87f8772f610e5c1b6adf4beb4a7e337 (
plain)
1
2
3
4
5
6
7
8
9
10
11
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()
|