diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..9cd64f2 --- /dev/null +++ b/public/index.html @@ -0,0 +1,23 @@ + + +
++ Look, front-end development is for script kiddies and soydevs who can't handle the real programming. I mean, + it's just a bunch of divs and spans, right? And css??? It's like, "Oh, I want this to be red, but not thaaaaat + red." What a joke. +
++ Real programmers code, not silly markup languages. They code on Arch Linux, not Mac OS, and certainly not + Windows. They use Vim, not VS Code. They use C, not HTML. Come to the backend, where the real programming + happens. +
+ + + diff --git a/public/styles.css b/public/styles.css new file mode 100644 index 0000000..a8c664c --- /dev/null +++ b/public/styles.css @@ -0,0 +1,27 @@ +body { + font-family: Arial, sans-serif; + line-height: 1.6; + margin: 0; + padding: 0; + background-color: #1f1f23; +} + +body { + max-width: 600px; + margin: 0 auto; + padding: 20px; +} + +h1 { + color: #ffffff; + margin-bottom: 20px; +} + +p { + color: #999999; + margin-bottom: 20px; +} + +a { + color: #6568ff; +} diff --git a/server.py b/server.py new file mode 100644 index 0000000..cee85ce --- /dev/null +++ b/server.py @@ -0,0 +1,40 @@ +import os +import argparse +from http.server import HTTPServer, SimpleHTTPRequestHandler + + +class CORSHTTPRequestHandler(SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header("Access-Control-Allow-Origin", "*") + self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS") + self.send_header("Access-Control-Allow-Headers", "*") + super().end_headers() + + def do_OPTIONS(self): + self.send_response(200, "OK") + self.end_headers() + + +def run( + server_class=HTTPServer, + handler_class=CORSHTTPRequestHandler, + port=8000, + directory=None, +): + if directory: # Change the current working directory if directory is specified + os.chdir(directory) + server_address = ("", port) + httpd = server_class(server_address, handler_class) + print(f"Serving HTTP on http://localhost:{port} from directory '{directory}'...") + httpd.serve_forever() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="HTTP Server with CORS") + parser.add_argument( + "--dir", type=str, help="Directory to serve files from", default="." + ) + parser.add_argument("--port", type=int, help="Port to serve HTTP on", default=8888) + args = parser.parse_args() + + run(port=args.port, directory=args.dir)