DerbyJS是一个MVC框架,帮助编写实时,交互的应用。可以运行在Node.js或者浏览器环境中。
示例代码:
hello.jsvar app = module.exports = require('derby').createApp('hello', __filename);app.loadViews(__dirname);// the route is being rendered both on server and client sideapp.get('/', function(page, model) { // subscription enables data synchronization model.subscribe('hello.message', function() { page.render(); });});
评论