Created
May 2, 2014 12:09
-
-
Save TerryMooreII/db6bb70e96f8dd84aee7 to your computer and use it in GitHub Desktop.
Code to generate the Regular Expression - Cardinal Solutions ALF blog post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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