• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

The folder /api is not accesible anymore

Explorer ,
Mar 01, 2018 Mar 01, 2018

Copy link to clipboard

Copied

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.

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 01, 2018 Mar 01, 2018

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 01, 2018 Mar 01, 2018

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2018 Mar 01, 2018

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 11, 2018 Dec 11, 2018

Copy link to clipboard

Copied

LATEST

@all

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation