# -*- coding: utf-8 -*-
import BaseHTTPServer

class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    '''处理请求并返回页面'''

    #页面模板
    Page = '''\
    <html>
    <body>
    <p>Test CI</p>
    </body>
    </html>
    '''
    #处理get请求
    def do_GET(self):
        self.send_response(200)
        self.send_header("Content-Type","text/html")
        self.send_header("Content-Length",str(len(self.Page)))
        self.end_headers()
        self.wfile.write(self.Page)

#--------------------------------------------------------------------

if __name__ == '__main__':
    serverAddress = ('', 8001)
    server = BaseHTTPServer.HTTPServer(serverAddress, RequestHandler)
    server.serve_forever()

