Created
August 18, 2017 15:59
-
-
Save volyx/2c7ce7aeb0cd973f50ae857da6d24d10 to your computer and use it in GitHub Desktop.
This file contains 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
@Grapes([ | |
@Grab('io.ratpack:ratpack-groovy:1.5.0-rc-2'), | |
@Grab('org.slf4j:slf4j-simple:1.7.25') | |
]) | |
import static ratpack.groovy.Groovy.ratpack | |
import ratpack.jackson.*; | |
class User { | |
String name; | |
String surname; | |
} | |
ratpack { | |
handlers { | |
get { | |
render Jackson.json(new User(name: "1", surname: "2")) | |
} | |
get(":name") { | |
render "Hello $pathTokens.name!" | |
} | |
} | |
} |
Author
volyx
commented
Aug 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment