Skip to content

Instantly share code, notes, and snippets.

@divideby0
Created November 15, 2011 00:44
Show Gist options
  • Save divideby0/1365728 to your computer and use it in GitHub Desktop.
Save divideby0/1365728 to your computer and use it in GitHub Desktop.
GrettyServer delivering static JSON response
import org.mbte.gretty.httpserver.GrettyServer
@GrabResolver(name='gretty', root='http://groovypp.artifactoryonline.com/groovypp/libs-releases-local')
@Grab('org.mbte.groovypp:gretty:0.4.302')
def server = new GrettyServer()
.localAddress(new InetSocketAddress(8080))
.defaultHandler { response.json = [foo: 'foo value', bar: 'bar value'] }
.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment