Created
November 10, 2016 10:02
-
-
Save codeboost/5eac63125e45186021809ccf18be2565 to your computer and use it in GitHub Desktop.
Clojurescript sample node http server
This file contains 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