title: How do I launch Python SimpleHTTPServer on heroku?
body: <p>I want to launch Python HTTPServer on heroku. Note that this is no Python framework. The code snippet is attached below. How will I be able to launch this server on Heroku? I am able to run this server on my local machine. But I want it deployed on Heroku. Please provide insights.</p>
  
  <p>Server Code:</p>
  
  <pre><code>import http.server
  from http.server import HTTPServer, BaseHTTPRequestHandler
  import socketserver
  import threading
  
  PORT = 5001
  
  class myHandler(BaseHTTPRequestHandler):
      def do_GET(self):
          self.write("Heroku is awesome")
  
  class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
      pass
  
  try:
      server = ThreadedTCPServer(('', PORT), myHandler)
      print ('Started httpserver on port ' , PORT)
      ip,port = server.server_address
      server_thread = threading.Thread(target=server.serve_forever)
      server_thread.daemon = True
      server_thread.start()
      allow_reuse_address = True
      server.serve_forever()
  
  except KeyboardInterrupt:
      print ('CTRL + C RECEIVED - Shutting down the REST server')
      server.socket.close()
  </code></pre>