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

Add ability to build from dev server

steve0greatness,
created on Sunday, 21 January 2024, 23:28:41 (1705879721), received on Monday, 6 May 2024, 02:55:35 (1714964135)
Author identity: Steve0Greatness <75220768+Steve0Greatness@users.noreply.github.com>

401bb0ab0e4b133ad85af295a407ec01dd071b15

dev-server.py

@@ -1,7 +1,16 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            from build import main as BuildStaticSite
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from flask import Flask
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from flask import Flask, redirect
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            app = Flask(__name__)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def Index():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return """<a href="/build">Rebuild site</a>"""
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/build")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def Builder():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            BuildStaticSite()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return redirect("/")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if __name__ == "__main__":
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                app.run("0.0.0.0", 9000)