code: function loadEndpoint(endpointSpecRootPath, resourcePath, method) {
    method = method.toUpperCase();
    return plugin.myrmex.fire('beforeEndpointLoad', endpointSpecRootPath, resourcePath, method)
    .spread(() => {
      const parts = resourcePath.split('/');
      const subPath = parts.join(path.sep) + path.sep + method;
      const spec = mergeSpecsFiles(endpointSpecRootPath, subPath);
  
      // We load the integration templates
      return Promise.map(spec.consume || [], contentType => {
        return loadIntegrationTemplate(path.join(endpointSpecRootPath, resourcePath, method), contentType)
        .then(integrationTemplate => {
          spec['x-amazon-apigateway-integration'] = spec['x-amazon-apigateway-integration'] || {};
          spec['x-amazon-apigateway-integration'].requestTemplates = spec['x-amazon-apigateway-integration'].requestTemplates || {};
          spec['x-amazon-apigateway-integration'].requestTemplates[contentType] = integrationTemplate;
          return Promise.resolve();
        });
      })
      .then(() => {
        // Lasy loading because the plugin has to be registered in a Myrmex instance before requiring ./endpoint
        const Endpoint = require('./endpoint');
        return Promise.resolve(new Endpoint(spec, resourcePath, method));
      });
    })
    .then(endpoint => {
      // This event allows to inject code to alter the endpoint specification
      return plugin.myrmex.fire('afterEndpointLoad', endpoint);
    })
    .spread((endpoint) => {
      return Promise.resolve(endpoint);
    });
  }
docs: Load an Endpoint specification
  From the `endpointSpecRootPath` directory, myrmex will look for a specification in
  each subdirectory following the structure `path/to/the/resource/HTTP_METHOD/`
  @param {string} endpointSpecRootPath - the root directory of the endpoint configuration
  @param {string} resourcePath - the URL path to the endpoint resource
  @param {string} method - the HTTP method of the endpoint
  @returns {Promise<Endpoint>} - the promise of an endpoint instance