1 Star 0 Fork 23

wangchenyang/cosjs

forked from wodaQ/cosjs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
hwclegend 提交于 2015-01-04 21:45 . Initial commit
require('./lib/global');
var config = require('./config');
exports.http = function () {
var server = require('./lib/server').create();
this.set = function(key,val){
this.config(key,val);
}
this.config = function(key,val){
if(typeof key =='object'){
for(var k in key){
config[k] = key[k];
}
}
else{
config[key] = val;
}
}
this.router = function(reg,api){
var router = require('./lib/router');
router.set(reg,api);
}
this.cookie = function(key,val){
var cookie = require('./lib/cookie').config;
if(typeof key =='object'){
for(var k in key){
cookie[k] = key[k];
}
}
else{
cookie[key] = val;
}
}
this.session = function(key,val){
var session = require('./lib/session').config;
if(typeof key =='object'){
for(var k in key){
session[k] = key[k];
}
}
else{
session[key] = val;
}
}
this.msgPack = function(fun){
server.msgPack = fun;
}
this.apiPack = function(fun){
server.apiPack = fun;
};
this.start = server.start;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangchenyang99/cosjs.git
git@gitee.com:wangchenyang99/cosjs.git
wangchenyang99
cosjs
cosjs
master

搜索帮助