code: def create_app(name, config=None, flask_params=None):
      
      from boiler.config import DefaultConfig
      if config is None:
          config = DefaultConfig()
  
      # get flask parameters
      options = dict(import_name=name)
      if flask_params is not None:
          options.update(flask_params)
      if config.get('FLASK_STATIC_URL') is not None:
          options['static_url_path'] = config.get('FLASK_STATIC_URL')
      if config.get('FLASK_STATIC_PATH') is not None:
          options['static_folder'] = config.get('FLASK_STATIC_PATH')
  
      # create an app
      app = Flask(**options)
  
      # configure app
      if config.__class__ is type:
          raise Exception('Config must be an object, got class instead.')
  
      app.config.from_object(DefaultConfig())
      app.config.from_object(config)
  
      # register error handler
      register_error_handler(app)
  
      # use kernel templates
      kernel_templates_path = path.realpath(path.dirname(__file__)+'/templates')
      fallback_loader = FileSystemLoader([kernel_templates_path])
      custom_loader = ChoiceLoader([app.jinja_loader, fallback_loader])
      app.jinja_loader = custom_loader
  
      # time restarts?
      if app.config.get('TIME_RESTARTS'):
          restart_timer.time_restarts(os.path.join(os.getcwd(), 'var', 'data'))
  
      # detect browsersync proxy
      @app.before_request
      def detect_browsersync():
          g.dev_proxy = False
          proxy_header = app.config.get('DEV_PROXY_HEADER')
          if proxy_header:
              g.dev_proxy = bool(request.headers.get(proxy_header))
  
      return app
docs: Create app
      Generalized way of creating a flask app. Use it in your concrete apps and
      do further configuration there: add app-specific options, extensions,
      listeners and other features.
  
      Note: application name should be its fully qualified __name__, something
      like project.api.app. This is how we fetch routing settings.