The simplest way of creating a Ratpack application is using a Groovy script. Create a file named ratpack.groovy
with the following content:
link:solution/ratpack.groovy[role=include]
What you see there is the Groovy DSL for Ratpack. Those not yet familiar with it, can try to guess what it’s defined there: 2 handlers for HTTP GET requests. We will explore handlers later.
Now let’s run that. Go to your terminal and run:
$ groovy ratpack.groovy
The first time you run it, it might take a while for Grape to resolve the dependencies.
Tip
|
You can use the JVM parameter -Dgroovy.grape.report.downloads=true to get output information about dependencies resolution.
|
Once it has finished, you can point your browser to http://localhost:5050 or http://localhost:5050/GR8Conf