A mirror of my website's source code.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Removed local-server: no longer needed(I'm running Jekyll locally)

steve0greatness,
created on Tuesday, 5 March 2024, 05:36:53 (1709617013), received on Monday, 6 May 2024, 02:55:38 (1714964138)
Author identity: Steve0Greatness <steve0greatnessiscool@gmail.com>

050ffb0e2eaf6d770dc06a731026bfc6235a9597

local-server.py

@@ -1,20 +0,0 @@

                                
                                
                                
                            
                                
                                    
                                        
                                        # This is a Flask server to emulate GitHub pages.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from flask import Flask, send_file as SendFile
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from os.path import isfile
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from pathlib import Path
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        FlaskOpts = {}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        app = Flask(__name__, **FlaskOpts)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/", defaults={"path": ""})
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/<path:path>")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def SendStatic(path):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            if isfile("build/" + path):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                return SendFile(Path("build").joinpath(path))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            elif isfile(Path("build").joinpath(path, "index.html")):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                return SendFile(Path("build").joinpath(path, "index.html"))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return SendFile("build/404.html")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if __name__ == "__main__":
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            app.run("0.0.0.0", 8000)