manim/scripts/simple_cors_http_server.py
pre-commit-ci[bot] eb09675fc5
[pre-commit.ci] pre-commit autoupdate (#2086)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-09-28 17:41:25 +08:00

17 lines
428 B
Python
Executable file

#!/usr/bin/env python3
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Access-Control-Allow-Origin", "*")
super().end_headers()
if __name__ == "__main__":
test(
CORSRequestHandler,
HTTPServer,
port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000,
)