mirror of
https://github.com/exchanges-lab/view.git
synced 2026-08-07 22:24:42 +08:00
Upload files.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Simple HTTP server for frontend development"""
|
||||
|
||||
import http.server
|
||||
import socketserver
|
||||
|
||||
PORT = 8080
|
||||
|
||||
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||
def end_headers(self):
|
||||
self.send_header('Access-Control-Allow-Origin', '*')
|
||||
self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
|
||||
self.send_header('Access-Control-Allow-Headers', '*')
|
||||
super().end_headers()
|
||||
|
||||
if __name__ == '__main__':
|
||||
socketserver.TCPServer.allow_reuse_address = True
|
||||
with socketserver.TCPServer(('', PORT), Handler) as httpd:
|
||||
print(f'Serving at http://localhost:{PORT}')
|
||||
print('Press Ctrl+C to stop')
|
||||
try:
|
||||
httpd.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
print('\nStopping...')
|
||||
httpd.shutdown()
|
||||
Reference in New Issue
Block a user