Created
May 15, 2011 12:49
-
-
Save seanparsons/973122 to your computer and use it in GitHub Desktop.
Static Web Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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