Coding/Python 삽질기

Simple Http Server 만들기

chobocho 2005. 3. 24. 00:59
#####################################################################
# Chobocho's Python Server
#
import CGIHTTPServer
import BaseHTTPServer

PORT = 9000

Handler = CGIHTTPServer.CGIHTTPRequestHandler
httpd = BaseHTTPServer.HTTPServer( ('', PORT), Handler)

print 'Listening on port', PORT
httpd.serve_forever()

# cgi-bin 디렉토리가 cgi 디렉토리이다.
# index.html이 기본으로 보여진다.