node-fse
v3.0.0
Published
Research and Application of Asynchronous Web Architecture Based on nodejs Light-weight Frameworks
Downloads
11
Readme
#保留目录
#保留文件名 </global.js> * </config/fse.js> *
#入口文件 fse.js 返回对象 调用 start 即开启服务。 路由规则:host:port/路径/文件名.调用目标,host:port/test/test.set 即嗲用test目录下test文件中set函数
#接口定义 文件存放api目录下 例: /api/test/test.js 固定格式 exports.接口名=function(app,数据访问层对象,配置){
} #接口注释 exports.接口名_explain = { params: [ { name: 'userName', remark: "用户名" } ], effect: "这是一个测试接口,没什么作用", return: { ip: '123456' }, auth: "作者", last: '2016-11-30', remark:'接口备注' };
#必须包含的文件说明 </config/fse.js> prot:端口 * limit:数据最大接收量 * header:初始响应头 *
</global.js> session_start:function(app,action,next) 会话启动时调用,函数内如不调用next()将不会进入路由 * session_end:function(app) 会话结束时调用 * global_erro:function(erro) 全局未捕获异常时调用 *
#保留目录说明 (!仅识别根目录文件)配置文件存放目录,启动时自动加载,在接口中 app.config.文件名 使用配置对象 存放接口文件,请勿把其他文件放入此目录防止对外暴露 (!仅识别根目录文件)数据访问层代码