コード例 #1
0
 def command_serve(self, options, args):
     '''Starts a local server'''
 
     static_app = DirectoryApp("static", index_page=None)
     
     # Create a cascade that looks for static files first, 
     #  then tries the other apps
     cascade_app = ExceptionMiddleware(cascade.Cascade([static_app, fever.setup_app(), frontend.setup_app()]))
     
     address = '0.0.0.0' if options.allow_remote_access else 'localhost'        
     httpd = make_server(address, options.port, cascade_app)
     print 'Serving on http://%s:%s' % (address, options.port)
     try:
         httpd.serve_forever()
     except KeyboardInterrupt:
         print 'Interrupted by user'            
コード例 #2
0
ファイル: app.py プロジェクト: sir-Gollum/coldsweat
def setup_app():
    # Postpone import to avoid circular dependencies
    import fever, frontend, cascade
    return ExceptionMiddleware(
        cascade.Cascade([fever.setup_app(),
                         frontend.setup_app()]))
コード例 #3
0
ファイル: app.py プロジェクト: Humoyun/coldsweat
def setup_app():    
    # Postpone import to avoid circular dependencies
    import fever, frontend, cascade
    return ExceptionMiddleware(cascade.Cascade([fever.setup_app(), frontend.setup_app()]))