11

If one is planning to create a UI-less web service (receives JSON and/or XML, returns JSON and/or XML), does Noir provide anything useful over and above Compojure?

animuson
  • 53,861
  • 28
  • 137
  • 147
Paul Butcher
  • 10,722
  • 3
  • 40
  • 44

2 Answers2

7

I believe Noir makes it a bit simpler to create JSON responses with noir.response/json: http://ibdknox.github.com/noir/noir.response-api.html#noir.response/json

On the other hand JSON support in Noir is just a very thin wrapper around clj-json (basically only adds json content-type header) so you can use clj-json directly instead of Noir for this purpose.

Rafał Dowgird
  • 43,216
  • 11
  • 77
  • 90
  • 8
    I'd suggest the [Cheshire](https://github.com/dakrone/cheshire) library if you're going to add JSON handling yourself. – semperos Feb 15 '12 at 23:20
  • 1
    I agree with both the answer and the above comment. I've recently been using Noir to provide a similar API and using it is an absolute dream. It makes it incredibly easy to define access to your API and cheshire is a wonderful JSON library. In my case, I was using [congomongo](https://github.com/aboekhoff/congomongo) to connect to a MongoDB instance which returns data in Mongo's native JSON format. – fredugolon Feb 16 '12 at 04:48
  • 2
    Also note Chris Granger's response [here](https://groups.google.com/forum/#!topic/clj-noir/INqvBo6oXIA/discussion), and [here](http://grokbase.com/t/gg/clj-noir/11ahzz6n7q/noir-post-json-data) describing how to use it to _receive_ JSON data. – Dax Fohl May 17 '12 at 03:22
4

You should choose Compojure, as Noir is now deprecated.

You'll find deprecation notice and recommendations here: https://github.com/noir-clojure/noir

clojureman
  • 421
  • 3
  • 4