lib/services/attachRoutes.js
function validPath(path, site) {
  let reservedRoute;

  if (path[0] !== '/') {
    log('warn', `Cannot attach route '${path}' for site ${site.slug}. Path must begin with a slash.`);
    return false;
  }

  reservedRoute = _.find(reservedRoutes, (route) => path.indexOf(route) === 1);

  if (reservedRoute) {
    log('warn', `Cannot attach route '${path}' for site ${site.slug}. Route prefix /${reservedRoute} is reserved by Amphora.`);
    return false;
  }

  return true;
}
function validPath(path, site) {
  let reservedRoute;

  if (path[0] !== '/') {
    log('warn', `Cannot attach route '${path}' for site ${site.slug}. Path must begin with a slash.`);
    return false;
  }

  reservedRoute = _.find(reservedRoutes, (route) => path.indexOf(route) === 1);

  if (reservedRoute) {
    log('warn', `Cannot attach route '${path}' for site ${site.slug}. Route prefix /${reservedRoute} is reserved by Amphora.`);
    return false;
  }

  return true;
}
function validPath ( path , site ) { let reservedRoute ; if ( path [ 0 ] !== '/' ) { log ( 'warn' , ` ${ path } ${ site . slug } ` ) ; return false ; } reservedRoute = _ . find ( reservedRoutes , ( route ) => path . indexOf ( route ) === 1 ) ; if ( reservedRoute ) { log ( 'warn' , ` ${ path } ${ site . slug } ${ reservedRoute } ` ) ; return false ; } return true ; }
Checks for validity of a route to be attached

@param {String} path
@param {Object} site
@returns {Boolean}
Checks for validity of a route to be attached