code: function addMatch (route) {
    let routePath = route.path
    let paramNames = []
    let matched
    // find any paths prefixed with `:` or `%`, and treat them as capture groups
    while ((matched = routePath.match(paramPattern)) !== null) {
      routePath = routePath.replace(paramPattern, '([^?/]+)')
      paramNames.push(matched[1])
    }
    // if a route ends with `index`, allow matching that route without matching the `index` part
    if (path.basename(routePath) === 'index') {
      route.isIndex = true
      routePath = routePath.replace(/\/index$/, '/?([:%]?index)?')
    }
    // create a regex with our path
    let pattern = new RegExp(`^${routePath}(\\?(.*)|$)`, 'i')
    route.pattern = pattern
    route.match = url => {
      let m = url.match(pattern)
      if (m) {
        let params = paramNames.reduce((o, p, idx) => {
          o[p] = m[idx + 1]
          return o
        }, {})
        let query = qs.parse(m[m.length - 1])
        return { params, query }
      }
    }
    return route
  }
docs: takes routes and decorates them with a 'match' method that will return { params, query } if a path matches