Created
April 26, 2024 07:59
-
-
Save trycf/c44737f24de286ec5a348f2b319d17b5 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains 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
<cfscript> | |
route = "/sources?limit=100&offset=100"; | |
path = listFirst( route, "?" ); | |
writeOutput( path ); | |
writeOutput( "<br/>" ); | |
writeOutput( "<br/>" ); | |
query = listRest( route, "?" ); | |
writeOutput( query ); | |
writeOutput( "<br/>" ); | |
writeOutput( "<br/>" ); | |
queryParams = createObject( "java", "coldfusion.util.HTMLTools" ).parseQuerystring( query ); | |
writeDump( queryParams ); | |
writeOutput( "<br/>" ); | |
uri = [ path ]; | |
queryParams = queryParams.reduce( function( result, key, value ) { | |
var res = arguments.value.reduce( function( r, i ) { | |
return arguments.r; | |
}, [] ); | |
return arguments.result; | |
}, [] ); | |
writeDump( queryParams ); | |
writeOutput( "<br/>" ); | |
writeOutput( "<br/>" ); | |
uri = arrayToList( uri, "?" ); | |
writeOutput( uri ); | |
writeOutput( "<br/>" ); | |
writeOutput( "<br/>" ); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment