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