Skip to content

Instantly share code, notes, and snippets.

Created November 10, 2016 10:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c14b2b57184c650d9f3ff0a9e1a84058 to your computer and use it in GitHub Desktop.
Save anonymous/c14b2b57184c650d9f3ff0a9e1a84058 to your computer and use it in GitHub Desktop.
Clojurescript node sample
(ns helloserver
(:require [cljs.nodejs :as nodejs]))
(def http (nodejs/require "http"))
(-> (.createServer http (fn [req res]
(doto res
(.writeHead 200 {"Content-Type" "text/plain"})
(.end "Hello from ClojureScript"))))
(.listen 8080 "127.0.0.1"))
(println "Running on port 8080")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment