Skip to content

Instantly share code, notes, and snippets.

@hhariri
Created March 28, 2013 18:08
Show Gist options
  • Save hhariri/5265486 to your computer and use it in GitHub Desktop.
Save hhariri/5265486 to your computer and use it in GitHub Desktop.
route.get("/abc", { req, res -> res.send("Hello") })
route("/abc", {
get { req, res -> res.send("Hello") }
post { req, res -> req.process(body) }
}
@jonnyzzz
Copy link

route("/abc") {
get { send("Hello") }
post { process(body) }
}

@hhariri
Copy link
Author

hhariri commented Mar 30, 2013

Just thinking, we could do it like that renaming to resource cause that's basically what it is.

@hhariri
Copy link
Author

hhariri commented Mar 30, 2013

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