So I've been trying to map an http module to a sub-path of an MVC3 site. It should be pretty simple as I understand it, but it has not been working. The module is setup like so:
<handlers> <add name="Nancy" path="api/*" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" allowPathInfo="true" /> </handlers>
A matching section is also there for iis6 so I can run it under webdev.webserver. However testing both deploying to my local iis7 (under Win7) and with webdev.webserver, only /api actually calls the handler. If I call /api/{anything} it just returns a 404.
I'm sure I'm just "doing it wrong (tm)" but any help would be appreciated.
Note: I've also tried a couple other configurations including using a tag and creating a /api folder and adding a web.config to that folder with a full wildcard.
Use the Handler Mappings feature page to manage a list of handlers that process requests for specific file types. Sort the list by clicking one of the feature page column headings or select a value from the Group by drop-down list to group similar items. Related scenarios. Build a Static Website on IIS.
An HTTPhandler may be defined as an end point that is executed in response to a request and is used to handle specific requests based on extensions. The ASP.Net runtime engine selects the appropriate handler to serve an incoming request based on the file extension of the request URL.
An ASP.NET HTTP handler is the process that runs in response to a request that is made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes . aspx files.
Simple. Just put the path, no wildcard.
<handlers> <add name="Nancy" path="api" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" allowPathInfo="true" /> </handlers>
This will match:
/api/{anything}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With