function getRoute(spec, shim) {
  let route = spec.route || '/'

  if (shim.isFunction(route)) {
    route = route()
  }

  if (route instanceof RegExp) {
    route = '/' + route.source + '/'
  } else if (shim.isArray(route)) {
    route = route.join(',')
  } else if (route[0] !== '/') {
    route = '/' + route
  }

  return route
}
Retrieves the route from the spec

@private
@param {object} spec middleware spec
@param {Shim} shim instance of shim
@returns {string} route route path