Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Created May 15, 2011 12:49
Show Gist options
  • Save seanparsons/973122 to your computer and use it in GitHub Desktop.
Save seanparsons/973122 to your computer and use it in GitHub Desktop.
Static Web Server
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.impl.DefaultCamelContext
@Grab(group="org.apache.camel",module="camel-jetty",version="2.7.0")
@Grab(group="org.slf4j",module="slf4j-nop",version="1.6.1")
class WebRouteBuilder extends RouteBuilder {
void configure() {
from("jetty:http://0.0.0.0/cake")
.inOut()
.setBody(constant("<html><title>Cake</title><body>Chocolate Cake Is The Best</body></html>"))
.end()
}
}
def camelContext = new DefaultCamelContext()
camelContext.addRoutes(new WebRouteBuilder())
camelContext.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment