Created
November 10, 2016 10:03
-
-
Save anonymous/c14b2b57184c650d9f3ff0a9e1a84058 to your computer and use it in GitHub Desktop.
Clojurescript node sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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