coupergateway / couper

Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects
https://couper.io
MIT License
85 stars 15 forks source link

endpoint operations #671

Open malud opened 1 year ago

malud commented 1 year ago

Currently an endpoint will match all requests by path, no matter what method the client uses.

endpoint "/**" {
   proxy {
        backend = "foo"
    }
}

This could be refined with a second endpoint label:

endpoint "/**" "POST" {
   response {
      status = 405
   }
}

But this would be the first block type which will have multiple labels with different meanings. For example the error_handler have multiple labels but its all the same: a error type. Therefore we could think about an endpoint attribute (list) to refine the endpoints mux registration by method.

So how a endpoint configuration would look like for multiple methods ?