类似MVC的代码如何在Node.js中运行?

Chi*_*Tol 25 javascript model-view-controller server-side serverside-javascript node.js

我开始了解node.js,我正在试图弄清楚我将如何做普通的MVC.例如,这是一个Django视图,它从数据库中提取两组记录,并将它们发送到模板中呈现.

def view(request):
    things1 = ThingsOne.objects.all()
    things2 = ThingsTwo.objects.all()
    render_to_response('template.html, {'things1': things1, 'things2': things2})
Run Code Online (Sandbox Code Playgroud)

类似的node.js函数可能是什么样的?

Den*_*tor 13

http://boldr.net/mvc-stack-node-js-ejsgi-scylla-mustache是一篇很棒的小文章,其中包含使用dirfferent Node模块的MVC模式的完整github示例.它还列出了当前可用的备用模块.它对我来说比http://howtonode.org/更好地回答了这个问题,它有一些好的关键但我在MVC上找不到任何东西.