Closed dmartinezg closed 10 years ago
Something like this:
raml.loadFile('api.raml').then( function(data) {
printResources(data.resources, '');
}, function(error) {
console.log('Error parsing: ' + error);
});
function printResources (resources, resourceUri) {
if (!!resources) {
resources.forEach(function(resource){
var relativeUri = resourceUri + resource.relativeUri;
resource.methods.forEach(function(method){
console.log(method.method.toUpperCase() + " " + relativeUri);
});
if(!!resource.resources) {
printResources(resource.resources, relativeUri);
}
});
}
}
Thanks for Code Snippets
running something like
apikit-node routes
should print something like: