Skip to content

Instantly share code, notes, and snippets.

@cataska
Created April 30, 2018 10:36
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 cataska/511431c22a285ce03fd6e864066a4dc3 to your computer and use it in GitHub Desktop.
Save cataska/511431c22a285ce03fd6e864066a4dc3 to your computer and use it in GitHub Desktop.
(ns server.core)
(def http (js/require "http"))
(def hostname "127.0.0.1")
(def port 3000)
(defn handler [req res]
(doto res
(.writeHead 200 {"Content-Type" "text/plain"})
(.end "Hello World\n")))
(doto (.createServer http handler)
(.listen port hostname
(fn [] (.log js/console (str "Server Running at http://" hostname ":" port "/")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment