diff --git a/meshenger_clientserve.py b/meshenger_clientserve.py index 21190e7..2cad69a 100644 --- a/meshenger_clientserve.py +++ b/meshenger_clientserve.py @@ -12,16 +12,23 @@ import unicodedata class ClientServeHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): - messageDir = "msg" + messageDir = "/msg" """ Serve index and messages """ def do_GET(self): + if self.path == '/': - self.path = "/index" + self.send_response(200) + self.send_header('Content-type', 'text/html') + self.end_headers() + + f = os.path.join( "webapp.html") + with open( f, 'r') as the_file: + self.wfile.write(the_file.read()) - if self.path == '/index' or self.path.startswith( self.messageDir ): + elif self.path == '/index' or self.path.startswith( self.messageDir ): return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) else: diff --git a/webapp.html b/webapp.html new file mode 100644 index 0000000..39f2462 --- /dev/null +++ b/webapp.html @@ -0,0 +1,181 @@ + + +
+ + + + + + +