Matador: MVC for Node
obvious.github.com
obvious.github.com
We still tack on Express requests and responses onto your controller instances.
Most of all, the router -> controller mapping with request filtering (middleware-like) is where Matador comes in most useful. We have other features we'd like to add, especially in the scaffolding layer, but figured we'd open source early and get developer feedback.
Thanks!
I wrote my own version of this last year, and found that it was a really good learning experience, but I didn't think it was worth publishing publicly. However, there is definitely room for a scaffolded MVC prototyping framework on top of Express, imo.
It keeps code out of the views.
...and put it in controllers, which is terrible for large-scale organization. I would hate to see what their back-end looks like.I recommend you check out Chris Wanstrath's mustache library for Ruby: https://github.com/defunkt/mustache#readme
module ViewHelpers
def gravatar
gravatar_id = Digest::MD5.hexdigest(self[:email].to_s.strip.downcase)
gravatar_for_id(gravatar_id)
end
def gravatar_for_id(gid, size = 30)
"#{gravatar_host}/avatar/#{gid}?s=#{size}"
end
def gravatar_host
@ssl ? 'https://secure.gravatar.com' : 'http://www.gravatar.com'
end
end
I argue this will get extremely tiresome for large websites.While Mustache sometimes seems like a solution in search of problem, I do like that it's completely logicless, and so forces all logic, even display logic, into the controller.