Hi Folks, I am currently configuring the REST pat...
# cfml-general
r
Hi Folks, I am currently configuring the REST path in the ColdFusion Administrator, pointing to a root folder where my CFCs are located. The setup works fine in my local environment, but I am encountering an issue in the development (dev) environment. While attempting to register the REST service in the dev environment, I am receiving the following error message: Error registering REST service. Please ensure that you have entered a proper mapping and path. Application Ratio could not be initialized. Reason: null I am unsure why this issue is occurring specifically in the dev environment. Any insights or suggestions would be greatly appreciated. Thank you for your help in advance.
q
Do you have an application.cfc / .cfm in line with those REST CFCs? Are other pages in that app loading correctly?
r
Hi, The application was running with
Application.cfm
in both the development and local environments, and the application file was located in the root directory. It seems I now need to configure the path and switch to using
Application.cfc
for proper REST service functionality. However, I'm a bit confused, as both my local and development environments are running ColdFusion 2021, yet it appears that only the development environment requires
Application.cfc
. This may be due to a recent patch update or a specific configuration difference between the environments. Would appreciate any insights on why this discrepancy exists between the two environments, despite both using the same version of ColdFusion.
q
I don't think ACF has any restrictions on using the Application.cfm. BUT there may be a setting in the CF Administrator that has the server only using the Application.cfc file. OR that application.cfm may be corrupted/not working.
👍 2
b
With a view toward the future, if you implement REST in ColdFusion, you have no choice but to switch from Application.cfm to Application.cfc. Application.cfm's <cfapplication> tag simply does not support advanced settings such as REST-specific configurations. All REST configurations must be done using Application.cfc. There is no direct equivalent in <cfapplication> for the struct "this.restSettings". This has direct relevance to your question. For example,
this.restSettings.enabled=true
enables REST and
this.restSettings.cfcLocation
defines the directory containing REST CFCs.
👍 1