HTTP: Exact Routing

I want to make an exact router for example.

HTTP.@register(Router, "GET", "/hello", myFunction)

If for example the url is /hello/any, not respond with the as /hello

this without declare the route: /hello/any

Perhaps declaring an additional router for /hello/* with a dummy handler may do it…

Seems like a reasonable feature request to HTTP.jl to support exact matching, perhaps using regexes like this:

HTTP.@register(Router, "GET", r"/hello$", myfunction)
1 Like

When i try

HTTP.@register(Router, "GET", r"/hello$", myfunction)

I get this error

ERROR: LoadError: MethodError: no method matching split(::Regex, ::Char; keepempty=false) 

Yes it doesn’t work; it was just a potential way to implement it in HTTP.

@quinnj, open an issue for the feature request?