title: Serve directory in Python 3
body: <p>I've got this basic python3 server but can't figure out how to serve a directory.</p>
  
  <pre><code>class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
          def do_GET(self):
              print(self.path)
              if self.path == '/up':
                  self.send_response(200)
                  self.end_headers()
                  self.wfile.write(b'Going Up')
              if self.path == '/down':
                  self.send_response(200)
                  self.end_headers()
                  self.wfile.write(B'Going Down')
  
  httpd = socketserver.TCPServer(("", PORT), SimpleHTTPRequestHandler)
  print("Server started on ", PORT)
  httpd.serve_forever()
  </code></pre>
  
  <p>If Instead of the custom class above, I simply pass <code>Handler = http.server.SimpleHTTPRequestHandler</code> into TCPServer():, the default functionality is to serve a directory, but I want to serve that directory and have functionality on my two GETs above.</p>
  
  <p>As an example, if someone were to go to localhost:8080/index.html, I'd want that file to be served to them</p>