Deactivated
03/05/2019, 10:05 AMrouting {
route("/todo", <http://HttpMethod.Post|HttpMethod.Post>) {
handle { println("POST /todo") }
route("/list", HttpMethod.Get) {
handle { println("GET /todo/list") }
}
}
}
Scenario2
routing {
method(<http://HttpMethod.Post|HttpMethod.Post>) {
route("/todo") {
handle { println("POST /todo") }
method(HttpMethod.Get) {
route("/list") {
handle { println("GET /todo/list") }
}
}
}
}
}
Both only work with POST /todo
david-wg2
03/05/2019, 10:12 AMDeactivated
03/05/2019, 10:31 AMrouting {
route("/todo") {
post { println("POST /todo") }
route("/list") {
handle { println("POST /todo/list") }
get { println("GET /todo/list") }
}
}
}
which generates:
POST /todo
POST /todo/list
GET /todo/list
Here I can inherit the http method from the parent and add an individual http method for the nested path as well