微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Derby.js hello.js JS 的 MVC 框架

程序名称:Derby.js hello.js

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

Derby.js hello.js 介绍

DerbyJS 是一个 MVC 框架,帮助编写实时,交互的应用。可以运行在
Node.js 或者浏览器环境中。

示例代码

hello.js

var app = module.exports = require('derby').createApp('hello', __filename);
app.loadViews(__dirname);

// the route is being rendered both on server and client side
app.get('/', function(page, model) {
  // subscription enables data synchronization
  model.subscribe('hello.message', function() {
    page.render();
  });
});

Derby.js hello.js 官网

http://derbyjs.com/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐