blob: 816c8a5a6aaec2ae985c3fb3ceebd1259a5a4f23 [file] [log] [blame]
#!/usr/bin/env python
import argparse
import os
import server
def abs_path(path):
return os.path.abspath(path)
def parse_args():
parser = argparse.ArgumentParser(description="HTTP server designed for extreme flexibility "
"required in testing situations.")
parser.add_argument("document_root", action="store", type=abs_path,
help="Root directory to serve files from")
parser.add_argument("--port", "-p", dest="port", action="store",
type=int, default=8000,
help="Port number to run server on")
parser.add_argument("--host", "-H", dest="host", action="store",
type=str, default="",
help="Host to run server on")
return parser.parse_args()
def main():
args = parse_args()
httpd = server.WebTestHttpd(, port=args.port,
use_ssl=False, certificate=None,
if __name__ == "__main__":