Skip to main content
Inspiring
March 1, 2018
Question

The folder /api is not accesible anymore

  • March 1, 2018
  • 3 replies
  • 1664 views

Hi,

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!!.

Thank you.

This topic has been closed for replies.

3 replies

Participant
December 11, 2018

@all

Appears to be a similar problem with naming a directory path with "/rest" as well.  "/Rest" works, "/rest" does not on CF9 (ouch)

Carl Von Stetten
Legend
March 1, 2018

Joseph,

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.

-Carl V.

Charlie Arehart
Community Expert
Community Expert
March 1, 2018

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.)

/charlie

/Charlie (troubleshooter, carehart. org)
Carl Von Stetten
Legend
March 2, 2018

Charlie,

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).

Inspiring
March 1, 2018

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.