Skip to content

Instantly share code, notes, and snippets.

@techforum-repo
techforum-repo / server.py
Last active April 20, 2023 17:30 — forked from razor-x/server.py
Python http.server that sets Access-Control-Allow-Origin header.
import os
import sys
import http.server
import socketserver
PORT = 8000
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')