packages/api-gateway/src/index.js
function findApi(identifier) {
  return loadApis()
  .then(apis => {
    const api = _.find(apis, (api) => { return api.getIdentifier() === identifier; });
    if (!api) {
      return Promise.reject(new Error('Could not find the API "' + identifier + '" in the current project'));
    }
    return api;
  });
}
function findApi(identifier) {
  return loadApis()
  .then(apis => {
    const api = _.find(apis, (api) => { return api.getIdentifier() === identifier; });
    if (!api) {
      return Promise.reject(new Error('Could not find the API "' + identifier + '" in the current project'));
    }
    return api;
  });
}
function findApi ( identifier ) { return loadApis ( ) . then ( apis => { const api = _ . find ( apis , ( api ) => { return api . getIdentifier ( ) === identifier ; } ) ; if ( ! api ) { return Promise . reject ( new Error ( 'Could not find the API "' + identifier + '" in the current project' ) ) ; } return api ; } ) ; }
Find an APIs by its identifier and return it with its endpoints
@param {string} identifier - the API identifier
@returns {Api} - the API corresponding to the  identifier
Find an APIs by its identifier and return it with its endpoints