基于Node.js,Express和Teddy的MVC Web框架:Roosevelt

jopen 10年前

Roosevelt是一个基于Node.js,Express和Teddy的MVC Web框架,使用 Teddy 作为 HTML 模板引擎,使用 Less 作为 CSS 预处理器。Roosevelt被设计成抽象所有建立一个典型应用程序快速的必要模板,设置健全的默认值与替代机制,并为您的应用程序提供了一个统一的MVC结构。

依赖说明

  • express - 一个最小的,灵活的Node.js的Web应用程序框架
  • teddy - 一个易于阅读的,基于HTML的,大多是逻辑较少的DOM模板引擎
  • less-middleware - Connect middleware for LESS compiling
  • formidable - a Node.js module for parsing form data, especially file uploads
  • wrench - used by the CLI tool to help you create your sample app

Controller files are just standard Express routes. For example:

module.exports = function(app) { // app is the Express app created by Roosevelt      // standard Express route    app.get('/about', function(req, res) {        // use Roosevelt to load a data model      var model = app.get('model')('about');        // render a Teddy template and pass it the model      res.render('about', model);    });  };


 

项目主页:http://www.open-open.com/lib/view/home/1386293354361