Last active
August 29, 2015 14:18
-
-
Save grimrose/a32d5f37ae80492099c1 to your computer and use it in GitHub Desktop.
Donovan in Groovy https://github.com/moznion/donovan
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
@Grapes([ | |
@Grab(group = 'net.moznion', module = 'donovan', version = '1.0.0'), | |
@Grab(group = 'org.eclipse.jetty', module = 'jetty-server', version = '9.2.10.v20150310'), | |
@Grab(group = 'org.slf4j', module = 'slf4j-simple', version = '1.7.12') | |
]) | |
import net.moznion.donovan.BasicAPIResponse | |
import net.moznion.donovan.DonovanJetty | |
def jetty = new DonovanJetty() | |
jetty.with { | |
get "/", { c -> | |
println c.dump() | |
c.renderJSON(new BasicAPIResponse(200, 'Hello!')) | |
} | |
start() | |
println url | |
join() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
withらしい書き方に。