Skip to content

Instantly share code, notes, and snippets.

@TerryMooreII
Created May 2, 2014 12:09
Show Gist options
  • Save TerryMooreII/db6bb70e96f8dd84aee7 to your computer and use it in GitHub Desktop.
Save TerryMooreII/db6bb70e96f8dd84aee7 to your computer and use it in GitHub Desktop.
Code to generate the Regular Expression - Cardinal Solutions ALF blog post
routePatterns: function(){
var services = alfAgent.properties.services;
var s = [];
for(var i=0; i < services.length; i++){
s.push(services[i].name.toLowerCase());
}
return routePatterns = {
post: "^\/(" + s.join("|") + ")$",
delete: "^\/(" + s.join("|") + ")\/(.+)$"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment