mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Tg panel patch 2 (#8085)
Co-authored-by: Cadyn Bombaci <cadynspacetechguy@gmail.com>
This commit is contained in:
15
tools/localhost-asset-webroot-server.py
Normal file
15
tools/localhost-asset-webroot-server.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
import os
|
||||
|
||||
class CORSRequestHandler(SimpleHTTPRequestHandler):
|
||||
def end_headers(self):
|
||||
self.send_header('Access-Control-Allow-Origin', '*')
|
||||
self.send_header('Access-Control-Allow-Methods', 'GET')
|
||||
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
|
||||
return super(CORSRequestHandler, self).end_headers()
|
||||
|
||||
os.makedirs('../data/asset-store/', exist_ok=True)
|
||||
os.chdir('../data/asset-store/')
|
||||
httpd = HTTPServer(('localhost', 58715), CORSRequestHandler)
|
||||
httpd.serve_forever()
|
||||
Reference in New Issue
Block a user