#!/usr/bin/env python3

import sys
from http.server import BaseHTTPRequestHandler, HTTPServer

class testRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)

        self.send_header('Content-type', 'text/html')
        self.end_headers()

        message = b"<!doctype html>ok\n"
        self.wfile.write(message)

def run():
    server_address = ('localhost', 8081)
    httpd = HTTPServer(server_address, testRequestHandler)
    httpd.serve_forever()

if __name__ == '__main__':
  sys.exit(run())
