Created
March 28, 2013 18:08
-
-
Save hhariri/5265486 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
route.get("/abc", { req, res -> res.send("Hello") }) | |
route("/abc", { | |
get { req, res -> res.send("Hello") } | |
post { req, res -> req.process(body) } | |
} | |
Just thinking, we could do it like that renaming to resource cause that's basically what it is.
How about this?
public class Customer(): Resource("/customer") {
override fun get() {
super<Resource>.get()
}
override fun post() {
super<Resource>.post()
}
override fun delete() {
super<Resource>.delete()
}
override fun put() {
super<Resource>.put()
}
override fun head() {
super<Resource>.head()
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
route("/abc") {
get { send("Hello") }
post { process(body) }
}