Skip to content

Instantly share code, notes, and snippets.

@broquaint
Created January 18, 2014 13:25
Show Gist options
  • Save broquaint/8490504 to your computer and use it in GitHub Desktop.
Save broquaint/8490504 to your computer and use it in GitHub Desktop.
The HTTP example from nodejs.org translated into ClojureScript.
(let [http (js/require "http")]
(do
(.listen
(.createServer http (fn [req res]
(do
(.writeHead res 200 #js {"Content-Type" "text/plain"})
(.end res "Hello World\n"))))
1337 "127.0.0.1")
(.log js/console "Server running at http://127.0.0.1:1337/")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment