Azure / Azure-Functions

1.12k stars 199 forks source link

Allow HttpTrigger to have empty routes #2473

Open brennfoster opened 7 months ago

brennfoster commented 7 months ago

In ASP.NET Core Web API, I can have an empty route on a controller that resolves when using the root url. When using Azure Function HttpTrigger, an empty route is currently impossible, even when using the ASP.NET Core Integration, and when disabling the home page.

Why is this behavior so different?

I should be able to have empty routes on an HttpTrigger.

vlmironov commented 3 months ago

As a temp workaround you can do the following as your route: Route = "{ignored:maxlength(0)?}" or Route = "{*ignored}" (this option will match any url)

https://stackoverflow.com/a/76419027/3224794