Skip to content

Instantly share code, notes, and snippets.

@casualjim
Created April 14, 2011 18:56
Show Gist options
  • Save casualjim/920207 to your computer and use it in GitHub Desktop.
Save casualjim/920207 to your computer and use it in GitHub Desktop.
dsl proposal for embedded servers
object Main {
def main(args: Array[String]) {
WebServer("src/main/webapp", Config.webServerPort) { server =>
server.inContext("/api") { context =>
context.mount("validate", new ValidateApp)
context.mount("channels", new MessageChannelApp)
context.mount("streams", new StreamsApp)
context.mount("", new AccountApp)
}
server.mount("plans", new PlanApp) //mounts in root context
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment