Add local serve script
This commit is contained in:
parent
cdd115dfc8
commit
c43c319d26
17
tools/serve
Executable file
17
tools/serve
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import SimpleHTTPServer
|
||||||
|
import SocketServer
|
||||||
|
import os
|
||||||
|
|
||||||
|
PORT = 8000
|
||||||
|
|
||||||
|
public_dir = os.path.join(os.path.dirname(__file__), '..', 'public')
|
||||||
|
os.chdir(public_dir)
|
||||||
|
|
||||||
|
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
|
||||||
|
Handler.extensions_map.update({
|
||||||
|
'': 'text/html',
|
||||||
|
});
|
||||||
|
httpd = SocketServer.TCPServer(("", PORT), Handler)
|
||||||
|
httpd.serve_forever()
|
Loading…
x
Reference in New Issue
Block a user