serve.py 508 B

1234567891011121314151617181920
  1. # Copyright 2018 Google LLC
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import SimpleHTTPServer
  5. import SocketServer
  6. PORT = 8000
  7. class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
  8. pass
  9. Handler.extensions_map['.js'] = 'application/javascript'
  10. # Without the correct MIME type, async compilation doesn't work
  11. Handler.extensions_map['.wasm'] = 'application/wasm'
  12. httpd = SocketServer.TCPServer(("", PORT), Handler)
  13. httpd.serve_forever()