Skip to content

Instantly share code, notes, and snippets.

@jponge
Created December 23, 2013 21:36
Show Gist options
  • Save jponge/8105168 to your computer and use it in GitHub Desktop.
Save jponge/8105168 to your computer and use it in GitHub Desktop.
module GoloUndertow
function main = |args| {
let counter = java.util.concurrent.atomic.AtomicInteger()
let server = io.undertow.Undertow.builder():
addListener(8080, "localhost"):
setHandler(|exchange| {
exchange: getResponseHeaders(): put(io.undertow.util.Headers.CONTENT_TYPE(), "text/plain")
exchange: getResponseSender(): send("Golo World #" + counter: incrementAndGet())
}): build()
server: start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment