magomimmo/modern-cljs

shoreleave.handler instead of compojure.handler in the tutorial 09

Closed this issue · 3 comments

Subject.

I'm complete newbie in clojurescript and in clojure and in web applications, so i may be completely wrong, but this snippet from tutorial 09 isn't being compiled.

(ns modern-cljs.remotes
  (:require [modern-cljs.core :refer [handler]]
            [shoreleave.handler :refer [site]]
            [shoreleave.middleware.rpc :refer [defremote wrap-rpc]]))

(defremote calculate [quantity price tax discount]
  (-> (* quantity price)
      (* (+ 1 (/ tax 100)))
      (- discount)))

(def app (-> (var handler)
             (wrap-rpc)
             (site)))

The error is

 clojure.lang.ExceptionInfo: java.io.FileNotFoundException: Could not locate shoreleave/handler__init.class or shoreleave/handler.clj on classpath., compiling:(modern_cljs/remotes.clj:1:1)

I changed shoreleave.handler to compojure.handler and, at least, boot dev started without errors. But it may be that i'm doing something wrong.

Hi, I'll dig into it later, or tomorrow. Thanks for the notification!

You're right. Becasue of the cut&paste something went wron in the text, but it is correct in the code. see here.

I just fixed the text.
thanks again for the help!

It's nothing. Thanks to you for usefull tutorial.