So here’s the problem. Lucee is not reading into subdirectories below the api
directory mapping. (This is what the documentation is saying in part 5)
I have three CFC’s.
/api/test-a.cfc
/api/test-b.cfc
/api/v1/test-c.cfc
Each cfc has one component with a rest endpoint defined.
/api/test-a.cfc has “resta” defined at the component level. You can hit it with a browser and get a successful return.
/api/test-b.cfc has “/v1/restb/abc” defined at both the component level (v1/restb) and the function level (abc). Likewise, you can hit it with a browser and get a successful return.
These two work fine.
However, the problem is that ANY cfc’s in a subdirectory under “/api” do not work.
For example, I have a subdirectory called “/api/v1” and inside it I have a cfc called “test-c.cfc”. In that cfc is a component with a component level rest path of “/v1/testc” defined. Normally, if you hit
the endpoint with that path, it should work but it doesn’t.
This is the problem that I think the documentation (Section 5) is referring to.
(See REST Services: Introduction :: Lucee Documentation)
Something on the server needs to be set to let Lucee understand pathing for REST services in directories that exist below the root mapping. In my case “/api”.
Why is this important? When organizing REST services, you have to be able to organize the CFCs in logical directories. Otherwise, it’s a mess to manage.
ColdFusion allows for this type of organization, and I believe Lucee may as well. Except Lucee needs some extra TLC to get it to work. Thus, the documentation states that you have to configure something on the webserver in such a way that Lucee can recognize other endpoints in subdirectories. At least that’s how I’m reading the documentation.
I’m new to Lucee so I’m deferring to someone in support who can help me close this last gap.
OS: Linux
Java Version: 11.0.21
Tomcat Version: Apache Tomcat/9.0.31
Lucee Version: 5.3.11.5