Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@solsend2l
Forked from danveloper/a.groovy
Last active August 29, 2015 14:13
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 solsend2l/93b1ba464f060449e9bf to your computer and use it in GitHub Desktop.
Save solsend2l/93b1ba464f060449e9bf to your computer and use it in GitHub Desktop.
@GrabResolver(name='netty', root='http://clinker.netty.io/nexus/content/repositories/snapshots')
@Grab('io.ratpack:ratpack-groovy:0.9.13-SNAPSHOT')
import ratpack.handling.Handler
import ratpack.server.*
RatpackServer.of { spec -> spec
.config(ServerConfig.noBaseDir())
.handler {
{ ctx -> ctx.render "Hello World!" } as Handler
}
} start()
@GrabResolver(name='netty', root='http://clinker.netty.io/nexus/content/repositories/snapshots')
@Grab('io.ratpack:ratpack-groovy:0.9.13-SNAPSHOT')
import ratpack.handling.Handler
import ratpack.server.*
Handler base = { ctx ->
ctx.render "Hello World!"
}
RatpackServer.of { spec -> spec
.config(ServerConfig.noBaseDir())
.handler { base }
} start()
@GrabResolver(name='netty', root='http://clinker.netty.io/nexus/content/repositories/snapshots')
@Grab('io.ratpack:ratpack-groovy:0.9.13-SNAPSHOT')
import ratpack.handling.Handler
import ratpack.server.*
Handler base = { ctx -> ctx.render "Hello World!" }
Handler route = { ctx -> ctx.render "Welcome $ctx.pathTokens.name!" }
RatpackServer.of { spec -> spec
.config(ServerConfig.noBaseDir())
.handlers { chain -> chain
.get(":name", route)
.get(base)
}
} start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment