__ ___ __ __ \ \/ / | / /___ ____/ /__ \ / |/ / __ \/ __ / _ \ / / /| / /_/ / /_/ / __/ /_/_/ |_/\____/\__,_/\___/
ynode 是一个个人项目,推荐在项目中使用 candyjs , candyjs 是从 ynode 演化而成并采用 MIT 许可的一个与 ynode 保持同步的项目。可在托管平台搜索 candyjs 了解
YNode 实现了 MVC (Model-View-Controller) 设计模式并基于该模式组织代码
YNode 实现了自动路由映射
YNode 高可扩展和高可配置
YNode 的代码简洁优雅 这是它的编程哲学
使用 YNode 你只需要从一个入口文件开始,入口文件的内容可以使用自带的工具来生成,详情参见 doc 目录中的文档
var YNode = require('ynode');
var App = require('ynode/web/Application');
var app = new App({
'id': 1,
// 定义调试应用
'debug': true,
// 定义应用路径
'appPath': __dirname + '/app'
});
new YNode(app).listen(8090, function(){
console.log('listen on 8090');
});
Y.app.getAppPath()
可得到该值Y.app.getRuntimePath()
可得到该值Y.app.getRootPath()
可得到该值|- index.js | |- node_modules 目录 | |- public 目录 | |- app 项目目录 | | | |-- apis | | | |-- controllers 普通控制器目录 | | | |-- user 用户组目录 | | | | | |-- IndexController.js - host:port/user/index 可以访问到该类 | | |-- OtherController.js - host:port/user/other 可以访问到该类 | | | |-- goods 商品组目录 | | | | | |-- IndexController.js - host:port/goods/index 可以访问到该类 | | |-- OtherController.js - host:port/goods/other 可以访问到该类 | | | -- views 普通控制器模板目录 | | | |-- user 用户组模板 对应上面用户组 | | | | | |-- index.html | | |-- other.html | | | -- goods 商品组模板 | | | | | |-- index.html | | |-- other.html | | | -- modules 模块 | | | |-- reg | | | | | |-- controllers 模块控制器目录 其下无子目录 | | | | | | | |-- IndexController.js | | | | | |-- views 模块模板目录 | | | | | | | |-- index.html | | | | | |-- 其他目录 | | | -- runtime 缓存目录 |
2020-07-14
2020-05-10
beforeAction()
返回值不为 true 时将阻止程序的运行beforeActionCall()
更名为 beforeAction()
afterActionCall()
更名为 afterAction()
2020-04-22
getTemplate(view, callback)
更名为 getTemplateContent(view, callback)
getTemplateFilePath(view)
更名为 findViewFile(view)
getTemplateFromPath()
2020-04-03
Component
的 inject
方法改名为 injectBehaviors
2019-12-23
YNode.Y
属性2019-02-25
2018-09-27
2018-08-22
2018-08-02
class
配置项修改为 classPath
2018-06-15
2018-05-10
2018-03-21
2018-03-15
2018-03-02
2018-01-24
2018-01-12
each()
方法2018-01-11
iterator()
和 remove(data)
方法2017-08-20
2017-06-20
2017-05-17
2017-05-12
read() 改为 get() readSync() 改为 getSync() write() 改为 set() writeSync() 改为 setSync()
2017-05-11
this.getView().getTemplate(...)
2017-05-08
2017-05-03
2017-05-02
TimeHelper.pad(str, length) to TimeHelper.stringLPad(str, pad, length)
2017-05-01
2017-04-11
2017-04-07
2017-04-07
Y
辅助类增加 include 方法以方便加载一个类 var Logger = Y.include('y/log/Logger');
2017-04-06
2017-03-31
2017-03-23
2017-02-28
2017-02-22
2017-02-20
2017-02-18
2017-02-17
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型