mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-18 03:25:33 +00:00
12 lines
416 B
Python
Executable File
12 lines
416 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
|
|
import sys
|
|
|
|
class CORSRequestHandler(SimpleHTTPRequestHandler):
|
|
def end_headers(self):
|
|
self.send_header('Access-Control-Allow-Origin', '*')
|
|
SimpleHTTPRequestHandler.end_headers(self)
|
|
|
|
if __name__ == '__main__':
|
|
test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8080) |