go-aah / aah

A secure, flexible, rapid Go web framework
https://aahframework.org
MIT License
691 stars 33 forks source link

Add option override the path config in nested routes #190

Closed jeevatkm closed 6 years ago

jeevatkm commented 6 years ago

The goal is to added an option to override the path config on nested routes.

Current behavior:

This enhancement:

Example:

api_v1 {
    path = "/v1"
    auth = "anonymous"

    routes {
        all_values {
            path = "/values"
            controller = "v1/ValueController"
            action = "List"

            routes {
                value_create {                  # /v1/values
                    method = "POST"
                }
                value_override_path {           # /v1/supervalues <==> /v1/values
                    path = "^/v1/supervalues"                    
                }
                value_get {                     # /v1/values/:key      
                    path = "/:key"

                    routes {                  
                        value_update {          # /v1/values/:key
                            method = "PUT"
                        }
                        value_delete {          # /v1/values/:key
                            method = "DELETE"
                        }
                    }
                }
            }
        } # end - all_values
    }
} # end - api_v1
jeevatkm commented 6 years ago

Its done 😄