blob: 2f3b563b1f382b9508d6201db73098d607c41815 [file] [log] [blame]
Andy Bavier3dcbe9b2016-03-07 16:20:45 -05001#!/usr/bin/python
2
3import BaseHTTPServer
Matteo Scandolo963efd72016-03-10 08:59:27 -08004
5
Andy Bavier3dcbe9b2016-03-07 16:20:45 -05006class HTTPHandlerOne(BaseHTTPServer.BaseHTTPRequestHandler):
Matteo Scandolo963efd72016-03-10 08:59:27 -08007 def do_GET(self):
8 # with open('./message.html', 'r') as msgfile:
9 with open('../../../../templates/message.html.j2', 'r') as msgfile:
10 message = msgfile.read()
11 self.wfile.write(message)
12
Andy Bavier3dcbe9b2016-03-07 16:20:45 -050013
14def run(server_class=BaseHTTPServer.HTTPServer,
15 handler_class=BaseHTTPServer.BaseHTTPRequestHandler):
Matteo Scandolo963efd72016-03-10 08:59:27 -080016 # server_address = ('192.168.0.1', 8000)
17 server_address = ('127.0.0.1', 8000)
Andy Bavier3dcbe9b2016-03-07 16:20:45 -050018 httpd = server_class(server_address, handler_class)
19 httpd.serve_forever()
20
21run(handler_class=HTTPHandlerOne)