Hello CF Community,
I recently upgraded from ColdFusion 10 to ColdFusion 2016 and I noticed that I can no longer access any pages that live in any folder named /api/.
For example: www.mysite.com/api/index.cfm now returns a 500 error "Application could not be found". See the following screenshot:
Note: when I installed ColdFusion 2016 I didn't select to install the API Manager service nor do I need it.
Thanks for your help!
This is because there is a cf servlet-mapping for /api/.
You can remove the mapping by going to cfinstall/cfusion/wwwroot/WEB-INF/web.xml. Search for the api servlet-mapping and comment it out.
Outstanding Dave, thank you.
I wonder if there's a way to do this on a per site basis or if the servlet-mapping is global for all sites on the server?
I just came across this issue as well. It seems to me that Adobe either didn't think this through or made an assumption that developers would be ok with this change. I would like to put in a feature request to allow you to change this behavior from the ColdFusion Administrator but when I went to the Feature Request/Bugs page, ColdFusion was not listed as an option.
The ColdFusion bug tracker can be accessed here: Tracker
When ColdFusion's REST features were first introduced, they could only be accessed as /rest/. There were many requests from the developer community to add /api/ as a common path for REST support, and IIRC it was added in CF 2016. However, not everyone uses the built-in REST features, and use either /rest/ or /api/ along with common frameworks (FW/1, ColdBox, Taffy, etc.) to provide rest services. So your suggestion to make it possible to disable the servlet mappings from within CF Administrator makes sense. Please submit a ticket in the URL above and then post the link here so others can go vote on this.