Skip to content

Instantly share code, notes, and snippets.

@namuan
Created August 27, 2013 10:29
Show Gist options
  • Save namuan/6351942 to your computer and use it in GitHub Desktop.
Save namuan/6351942 to your computer and use it in GitHub Desktop.
Groovy micro web framework
@GrabExclude(group='org.eclipse.jetty.orbit', module='javax.servlet', version='3.0.0.v201112011016')
@Grapes([
@Grab('org.eclipse.jetty.aggregate:jetty-server:8.1.2.v20120308'),
@Grab('org.eclipse.jetty.aggregate:jetty-servlet:8.1.2.v20120308'),
@Grab(group='javax.servlet', module='javax.servlet-api', version='3.0.1'),
@Grab(group='org.eclipse.jetty', module='jetty-server', version='9.0.4.v20130625'),
@Grab(group='com.sparkjava', module='spark-core', version='1.0')
])
import static spark.Spark.*
import spark.*
get(new Route("/hello/:name") {
@Override
def handle(Request request, Response response) {
def name = request.params(":name")
return "Hello " + name
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment