#koa-saber
Koa saber, but a tools kit.
- First commit.
- In app.js
var koa = require('koa'),
koa_gzip = require('koa-gzip'),
koa_derouter = require('koa-derouter'),
koa_saber = require("koa-saber");
var app = koa();
//初始化配置
koa_saber({
config_path: process.cwd() + "/common/config.js",
function_path : process.cwd() + "/common/function.js",
});
$.config("app_path",process.cwd());
//规定中间件
app.use(koa_gzip());
app.use(koa_derouter($.config("derouter")));
//启动服务器
app.listen(3000);
###Tip
- Functions in function.js will be added into saber($), but only function.