Skip to content

Commit

Permalink
Working example of Sente on node.js
Browse files Browse the repository at this point in the history
Currently requires my version of 1.8.0-alpha1, will update if PR is
accepted.
  • Loading branch information
theasp committed Jan 31, 2016
1 parent 4271492 commit e9c8903
Show file tree
Hide file tree
Showing 3 changed files with 250 additions and 128 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
pom.xml*
.env
/resources/public/*.js
/node_modules
51 changes: 34 additions & 17 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,70 @@
[;; [org.clojure/clojure "1.7.0"]
[org.clojure/clojure "1.8.0"]

[org.clojure/clojurescript "1.7.170"]
[org.clojure/clojurescript "1.7.228"]
[org.clojure/core.async "0.2.374"]
[org.clojure/tools.nrepl "0.2.12"] ; Optional, for Cider

[com.taoensso/sente "1.8.0-alpha1"] ; <--- Sente
[com.taoensso/timbre "4.2.1"]

;;; ---> Choose (uncomment) a supported web server <---
[http-kit "2.1.21-alpha2"]
;; [org.immutant/web "2.1.0"] ; v2.1+ recommended
;; [nginx-clojure/nginx-clojure-embed "0.4.2"] ; Needs v0.4.2+
[org.clojars.whamtet/dogfort "0.2.0-SNAPSHOT"]

[ring "1.4.0"]
[ring/ring-defaults "0.1.5"] ; Includes `ring-anti-forgery`, etc.
;; [ring-anti-forgery "1.0.0"]

[compojure "1.4.0"] ; Or routing lib of your choice
[hiccup "1.0.5"] ; Optional, just for HTML
[hiccups "0.3.0"] ; Optional, just for HTML

;;; Transit deps optional; may be used to aid perf. of larger data payloads
;;; (see reference example for details):
[com.cognitect/transit-clj "0.8.285"]
[com.cognitect/transit-cljs "0.8.237"]]

:npm
{:dependencies
[[source-map-support "*"]

;; Express
[express "4.13.3"]
[express-ws "1.0.0-rc.2"]
[body-parser "1.14.1"]
[cookie-parser "1.4.0"]
[express-session "1.11.3"]
[csurf "1.8.3"]

;; ws is needed for dogfort and express
[ws "0.8.0"]]}

:plugins
[[lein-pprint "1.1.2"]
[lein-ancient "0.6.8"]
[com.cemerick/austin "0.1.6"]
[lein-cljsbuild "1.1.2"]
[lein-shell "0.5.0"]
[lein-npm "0.6.1"]
[cider/cider-nrepl "0.10.1"] ; Optional, for use with Emacs
]

:cljsbuild
{:builds
[{:id :cljs-client
:source-paths ["src"]
[{:id :cljs-server
:source-paths ["src-server"]
:compiler {:main "example.server"
:output-to "target/main.js"
:output-dir "target/out"
:target :nodejs
;;:optimizations :simple
;;:source-map "target/main.js.map"
:optimizations :none
:source-map true
:pretty-print true}}
{:id :cljs-client
:source-paths ["src-client"]
:compiler {:output-to "resources/public/main.js"
:optimizations :whitespace #_:advanced
:pretty-print true}}]}

:main example.server

;; Call `lein start-repl` to get a (headless) development repl that you can
;; connect to with Cider+emacs or your IDE of choice:
:aliases
{"start-repl" ["do" "cljsbuild" "once," "repl" ":headless"]
"start" ["do" "cljsbuild" "once," "run"]}
{"start" ["do" "npm" "install," "cljsbuild" "once," "shell" "node" "target/main.js"]}

:repositories
{"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"})
Loading

0 comments on commit e9c8903

Please sign in to comment.