coffeekup icon indicating copy to clipboard operation
coffeekup copied to clipboard

using coffeekup with express

Open cocodrino opened this issue 13 years ago • 0 comments

Hi maurice..I've a doubt..is possible write inline views inside my express controllers?..similar to zappa:

@view hi: -> h1 @name

I've used clojure noir and I like a lot the idea define my views inside my controller (I know than mvc is better but I don't like) a noir example would be this:

(defpage "/cookie" []                         ;;defpage is similar to app.get
   (cookie/put! :noir "stuff")
    (let [v (cookie/get :noir)]               ;; v= cookie/get(noir)
         (layout                                          ;;layout is a function...similar to coffeekup...sweet
         [:p "You created a cookie:"]
         [:p "Value " v])))

is very nice for small apps and now than I found coffeekup I think it can fix me perfect....

thanks

cocodrino avatar Dec 01 '11 15:12 cocodrino