noir vs compojure? [英] noir vs compojure?

查看:131
本文介绍了noir vs compojure?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解clojure的Noir库的问题。它似乎是一个写在compojure顶部的框架,重命名defroute到defpage,并调用它一天。显然是一个不公平的简化,但是诺伊尔到底是什么?为什么我使用Noir而不是纯compojure + hiccup?

I'm having trouble understanding the point of clojure's Noir library. It seems to be a framework written on top of compojure that renames defroute to defpage and calls it a day. Obviously an unfair simplification, but what exactly does Noir bring to the table? Why would I use Noir instead of plain compojure+hiccup?

编辑/更新:
Noir已过时,有趣的写在这里: http://blog.raynes.me/blog/2012/12/13/moving-away-from -noir /

推荐答案

Compojure是一个小框架,它生成Ring请求/响应处理程序,基于您定义的路由。

Compojure is a small framework that generates Ring request/response handlers, where handlers are chosen based on routes you define.

Noir增加了会话处理,cookie,模板和分支的功能,更简单的生成响应,表单验证,路由过滤器, JSON(解)序列化和自定义状态页。换句话说,Noir将Compojure,Hiccup和一些其他聪明的东西组合在一个包中

Noir adds functionality for session handling, cookies, templates and partials, an easier way to generate responses, form validation, route filters, encrypted passwords, JSON (de-)serialising and custom status pages. In other words, Noir combines Compojure, Hiccup, and a bunch of other clever stuff in one package.

这篇关于noir vs compojure?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆