Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2016 08:04
What would you like to do?
Cannot get boot-http :not-found handler to work when running `boot dev`
:source-paths #{"src/cljs" "src/clj"}
:resource-paths #{"resources"}
:target-path "target"
:dependencies '[[org.clojure/clojure "1.7.0"]
[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[adzerk/boot-reload "0.4.5" :scope "test"]
[pandeiro/boot-http "0.7.3" :scope "test"]
[org.clojure/clojurescript "1.7.228"]
[crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT" :scope "test"]
[reagent "0.6.0-alpha"]
[cljs-ajax "0.5.3"]
[secretary "1.2.3"] ; todo remove
[bidi "1.25.1"]
[com.andrewmcveigh/cljs-time "0.4.0"]
[kibu/pushy "0.3.6"]
[cljsjs/moment "2.10.6-1"]
[re-frame "0.7.0-alpha"]
[adzerk/boot-template "1.0.0"]
[matchbox "0.0.8-SNAPSHOT"]])
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[pandeiro.boot-http :refer [serve]]
'[ :as io]
'[reps.server :refer [not-found-handler]])
(deftask build []
(comp (speak)
(deftask run []
(comp (serve :not-found 'not-found-handler) ;; note this
(deftask production []
(task-options! cljs {:optimizations :advanced})
(deftask development []
(task-options! cljs {:optimizations :none :source-map true}
reload {:on-jsload '})
(deftask prod []
(comp (production)
(deftask dev
"Simple alias to run application in development mode"
(comp (development)
(ns reps.server
(:require [ring.util.response :refer [file-response]]))
(defn not-found-handler [request]
(file-response "target/index.html")
[:headers "Content-Type"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment