3

How can I configure a single IIS handler mapping path to allow all traffic starting with /rest/*, regardless of the number of subdirectories/subpaths, to be forwarded to ColdFusion?

Background: We run Lucee 4.5 behind IIS 8 connected with BonCode on our production environment. We are trying to implement our first of many REST endpoints using the native REST functionality in Lucee. As a result, all of our REST URIs begin with /rest/ even though this is not configured anywhere as a physical or virtual directory. I am able to add individual handler mappings to IIS in order to successfully pass traffic to specific subdirectories to ColdFusion.

The following are all examples of REST URIs and the associated handler mapping path that I had to add in order to get them to work. I would like to add a single handler mapping to encompasses them all.

REST endpoint:  /rest/logout
IIS handler mapping path:  /rest/*

REST endpoint:  /rest/service/callback
IIS handler mapping path:  /rest/service/*
(the first mapping path of /rest/* would not work for "deeper" subdirectories).

Is there a way I can specify "all traffic beginning with /rest/* regardless of the number of subdirectories"? It seems like there has to be a way to accomplish this without needing to add new entries for every new subdirectory that comes along ... ? Many thanks.

Tal F.
  • 71
  • 5
  • I am using Lucee 4.5 with IIS7. Whenever I try & make a REST API request, I get a 404, "Page Not Found. On my laptop with ACF, everything works fine? Do I have to add some kind of setting in the 'web.config', to make the REST API work on Lucee [Apache/Tomcat] on Windows 2008R2? I am tearing my hair out over this issue. Any help would be much appreciated! – Charles Robertson Aug 09 '18 at 21:18
  • Just to let you know, I have used this.webAdminPassword = 'mypasssord' and RestInitApplication(dirPath,serverMapping) etc part correctly, so I feel it is an IIS to Lucee issue? – Charles Robertson Aug 09 '18 at 21:22

1 Answers1

2

Found it. Apparently my search-fu was weak last weak when I posted the original question. I went looking again and found a solution!

How to register HttpHandler for all subfolders in Asp.Net?

In a nutshell you define a object in the web.config that maps to the subdirectory/URI (in my case, /rest), and then add a single wildcard handler to that location which handles all requests under that URI.

Tal F.
  • 71
  • 5