Herwig/Marko,

Below is the code - 

(def my-app (app
             wrap-stacktrace
             (wrap-file "resources/public/")
             [""] "Hello World"
             ["/"] "Hello World Second"
             [page] (-> (chrome page) response constantly)
             [&] (-> "Nothing was found" response (status 404) constantly)))

I am getting "Hello world" response on "" in the browser, but it also gives 
me an error in the server terminal.

I have posted my code on https://github.com/murtaza52/mfaiz. Any ideas on 
what could be causing the error ?

Thanks,
Murtaza 

On Saturday, September 8, 2012 1:32:50 AM UTC+5:30, Marko Topolnik wrote:
>
> For the record, Moustache does support the special case of returning a 
> literal string response:
>
> user> (run-jetty (app ["hi"] "Hello, world!\n") {:port 8888 :join? false})
>
> $ curl localhost:8888/hi
> Hello, world!
>
>
> On Friday, September 7, 2012 7:06:42 PM UTC+2, Murtaza Husain wrote:
>>
>>
>> Herwig,
>>
>> Thanks for the detailed answers below. 
>>
>> Hi Murtaza,
>>
>> moustache handlers must be functions. So to return a string as a 
>> response, the last line would have to be
>>
>> [&] (constantly "Nothing was found")
>>
>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to