Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
http.server example
(ns http.server
(:require [vertx.http :as http]))
(def server (http/server))
(defn vertx-start
(-> server
(fn [req resp]
(println (str "Got request: " (:uri req)))
(println "Headers are:")
(doseq [[header-name header] (:headers req)]
(println (str header-name ":" header)))
(-> resp
(http/header "Content-Type" "text/html; charset=UTF-8")
(http/end "<html><body><h1>Hello from vert.x!</h1></body></html>"))))
(http/listen 8080)))
(defn vertx-stop
(http/close server))

This comment has been minimized.

Copy link

@mvasilkov mvasilkov commented May 10, 2012

Did you, by any chance, check how does the performance penalty compares to others (esp. Groovy)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment