Skip to content

Instantly share code, notes, and snippets.

@nasser
Created June 11, 2016 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasser/aec17edb60a546aae6e588d6f891d963 to your computer and use it in GitHub Desktop.
Save nasser/aec17edb60a546aae6e588d6f891d963 to your computer and use it in GitHub Desktop.
Node.js Hello World in CLJS
$ npm install -g clojurescript
$ npm install express
$ cat node_modules/hello.cljs
(ns hello)
(def express (js/require "express"))
(def app (express))
(.get app "/" (fn [req res] (.send res "Hello World!")))
(.listen app 3000 #(console.log "Example app listening on port 3000!"))
$ cljs
cljs.user=> (require 'hello)
nil
cljs.user=> Example app listening on port 3000!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment