Remove wrap-transit-response from your routes. You need to add
(wrap-transit-response) to your middleware just like you have
(wrap-transit-params). The latter handles incoming request params, while
the former response collections.
On Friday, November 28, 2014 2:00:20 PM UTC, Thomas wrote:
>
> Hi,
>
> I am using the ring-transit middleware but something doesn't seem to be
> quite right. Below is the code on the server side:
>
> (defn get-test-data []
> {:a 1 :b 2})
>
> (defroutes app-routes
> (GET "/" [] (main-page))
> (wrap-transit-response
> (GET "/test" [] (get-test-data)))
> (route/resources "/")
> (route/not-found "Not Found"))
>
> (def app
> (-> app-routes
> (handler/site)
> (wrap-transit-params)))
>
> On the client I am getting this error when using cljs-ajax:
>
> something bad happened: 200 Unexpected end of input Format should have
> been Transit
>
> and the content-length is reported as 0 by postman. I am sure the error is
> between my ears ;) but I have no idea what!! Any ideas?
>
> TIA,
> Thomas
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.