mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 16:02:23 +03:00
00df96f173
[rebuild] [release]
15 lines
553 B
Python
Executable File
15 lines
553 B
Python
Executable File
#!/usr/bin/env python3
|
|
# This serves the current directory over HTTP. We need something more than
|
|
# `python3 -m http.server 8000` to inject the CORS header.
|
|
|
|
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 8000)
|