Created
June 11, 2016 11:35
-
-
Save nasser/aec17edb60a546aae6e588d6f891d963 to your computer and use it in GitHub Desktop.
Node.js Hello World in CLJS
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
$ 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