forked from intechstudio/grid-fw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_server.py
More file actions
22 lines (19 loc) · 697 Bytes
/
Copy pathgui_server.py
File metadata and controls
22 lines (19 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import http.server
import socketserver
import sys
PORT = 8000
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
self.send_header("Pragma", "no-cache")
self.send_header("Expires", "0")
super().end_headers()
try:
with socketserver.TCPServer(("", PORT), MyHTTPRequestHandler) as httpd:
print("serving at port", PORT)
print("http://localhost:8000/grid_gui/build/index.html")
httpd.serve_forever()
except KeyboardInterrupt:
print("\nCtrl+C detected. Shutting down the server.")
httpd.server_close()
sys.exit(0)