manim/scripts/simple_cors_http_server.py
GameDungeon daf23c9d10
Upgraded typehints (#2429)
* Future Annotations

* Delete template_twitter_post.py

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

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

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

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

* Apply suggestions from code review

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

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

* Fixed broken RTD

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-20 12:26:21 +08:00

19 lines
480 B
Python
Executable file

#!/usr/bin/env python3
from __future__ import annotations
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler, test # type: ignore
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,
)