Given a minimal example of a Coldfusion rest service (named "FileStore"):
component
restpath = ""
rest = true
{
remote void function getFile(
required string path restargsource = "Path"
)
httpmethod = "GET"
restpath = "{path}"
{
var file = FileReadBinary( "/some/path/to/local/files/#path#" );
var mimetype = customFunctionToGetMimeType( getFileFromPath( path ) );
cfcontent( variable = file, type = mimetype );
}
}
This will match paths:
/rest/FileStore/file1.pdf
/rest/FileStore/file2.jpg
But if you try sub-directories - i.e.
/rest/FileStore/subdir1/file3.xml
/rest/FileStore/subdir2/subsubdir1/file4.raw
It returns HTTP status 404 Not Found
(as, I'm assuming, it cannot find a matching REST service).
Is there a way to get the rest path to match all sub-paths?