1cb93a386Sopenharmony_ci#!/usr/bin/env python3
2cb93a386Sopenharmony_ci# Copyright 2018 Google LLC
3cb93a386Sopenharmony_ci#
4cb93a386Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci# found in the LICENSE file.
6cb93a386Sopenharmony_ci
7cb93a386Sopenharmony_ciimport http.server
8cb93a386Sopenharmony_ciimport socketserver
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_ciPORT = 8000
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ciclass Handler(http.server.SimpleHTTPRequestHandler):
13cb93a386Sopenharmony_ci    pass
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_ciHandler.extensions_map['.js'] = 'application/javascript'
16cb93a386Sopenharmony_ci# Without the correct MIME type, async compilation doesn't work
17cb93a386Sopenharmony_ciHandler.extensions_map['.wasm'] = 'application/wasm'
18cb93a386Sopenharmony_ci
19cb93a386Sopenharmony_cihttpd = socketserver.TCPServer(("", PORT), Handler)
20cb93a386Sopenharmony_ci
21cb93a386Sopenharmony_cihttpd.serve_forever()
22