Skip to content

Commit 9c90338

Browse files
author
Luc
committed
Add reference to owner j0hnlittle
set web port as variable add some help to launch browser on startup Thanks again @j0hnlittle
1 parent 5f8ecc4 commit 9c90338

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/server.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
#original file and idea come from https://github.com/j0hnlittle
23

34
import SimpleHTTPServer, SocketServer
45
import sys
@@ -9,6 +10,7 @@
910
#Replace this with a different path if you need to...
1011
base_path = os.path.join(os.getcwd(),"..","esp8266","data")
1112
tools_path = os.getcwd();
13+
server_port=8080
1214

1315
class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
1416
def do_GET(self):
@@ -91,9 +93,13 @@ def process_tag(self, data, tag, json_dic={}):
9193
print "="*60
9294
print "Serving files from:"
9395
print base_path
96+
print "\ntags.json is located at:"
97+
print tools_path
98+
print "\nOpen your browser at http://localhost:" + str(server_port)
99+
94100
os.chdir(base_path)
95101
print "="*60
96102
handler = MyHandler
97-
server = SocketServer.TCPServer(("",8080), handler)
103+
server = SocketServer.TCPServer(("",server_port), handler)
98104
server.serve_forever()
99105

0 commit comments

Comments
 (0)