Skip to content

Instantly share code, notes, and snippets.

Embed
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
(http/on-request
(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))
@mvasilkov

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.