Skip to content

Instantly share code, notes, and snippets.

@grimrose
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grimrose/a32d5f37ae80492099c1 to your computer and use it in GitHub Desktop.
Save grimrose/a32d5f37ae80492099c1 to your computer and use it in GitHub Desktop.
@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()
}
@grimrose
Copy link
Author

grimrose commented Apr 7, 2015

withらしい書き方に。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment