We have the folder path called /api and after we upgraded from Coldfusion 10 to Coldfusion 2016 the Coldfusion module inside that folder is not longer working. It's giving us the status error code 500. Different folder path is fine only particular folder /api won't work. Please help!!.
I fixed it by editing web.xml inside the folder /cfusion/wwwroot/WEB-INF. I changed the url-pattern inside the servlet-mapping id="coldfusion_mapping_16" from /api to /api2.
As you discovered, CF2016 added a servlet mapping to reserve /api for the built-in REST functionality, much like how /rest was previously reserved in CF10 thru CF2016. Either changing that servlet mapping, or commenting it out entirely will allow you to use the /api path for your own purposes, independent of the built-in REST functionality.
Actually, it seems to be something done in CF11 update 11.
And technically it’s caused by a new line in the uriworkermap.properties file. So that is another way to “fix” things, though at the cost of breaking whatever in CF may have been relying on that api folder name.
(Probably best for folks to rename their /api folders, as distasteful as that may seem, to avoid breaking something about CF’s use of the /api foldername, which they may want to leverage in the future.)
Thanks for the reminder - I forgot that came in mid-stream of the CF11 lifecycle.
I agree, somewhat with recommending people to rename their /api folders... Except, if they have no intention of using the CF built-in REST stuff. "/api" is a pretty widely used convention for the path to, well, APIs. And I'd wager that the majority of folks who are building REST APIs in ColdFusion are NOT using the built-in stuff (they're probably using Taffy, ColdBox, FW/1, or another framework or homegrown solution).
Appears to be a similar problem with naming a directory path with "/rest" as well. "/Rest" works, "/rest" does not on CF9 (ouch)