code: def add(self, rule, method, target, name=None, static=False):
          ''' Add a new route or replace the target for an existing route. '''
          if static:
              depr("Use a backslash to escape ':' in routes.") # 0.9
              rule = rule.replace(':','\\:')
  
          if rule in self.routes:
              self.routes[rule][method.upper()] = target
          else:
              self.routes[rule] = {method.upper(): target}
              self.rules.append(rule)
              if self.static or self.dynamic: # Clear precompiler cache.
                  self.static, self.dynamic = {}, {}
          if name:
              self.named[name] = (rule, Nonef add(self, rule, method, target, name=None, static=False):
          ''' Add a new route or replace the target for an existing route. '''
          if static:
              depr("Use a backslash to escape ':' in routes.") # 0.9
              rule = rule.replace(':','\\:')
  
          if rule in self.routes:
              self.routes[rule][method.upper()] = target
          else:
              self.routes[rule] = {method.upper(): target}
              self.rules.append(rule)
              if self.static or self.dynamic: # Clear precompiler cache.
                  self.static, self.dynamic = {}, {}
          if name:
              self.named[name] = (rule, None)
docs: Add a new route or replace the target for an existing route.