在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ptariche/ecma7-koa2-starter开源软件地址:https://github.com/ptariche/ecma7-koa2-starter开源编程语言:JavaScript 100.0%开源软件介绍:ECMA7 Koa2 StarterPREREQUISITES
Routes
Environment Variablesprocess.env.SECRET
process.env.SALT
process.env.PORT
process.env.COUCHBASE_URI
process.env.COUCHBASE_BUCKET
process.env.PASSWORD To Runnpm install && gulp && npm start Function to Chain a Class with Await/asynchelpers.chain = async (_functions) => {
let _this = null;
let result = null;
for (let i = 0; i < _functions.length; i++) {
let _function = _functions[i];
result = _this ? await _this[_function]() : await _function();
_this = result;
};
return result;
}; Example of Chain Functionconst CHAIN = require('./../../helpers/index').chain;
let UserController = require('./../../controllers/user');
module.exports.post = async (ctx, next) => { return ctx.body = await CHAIN([() => { return new UserController(ctx, next); }, 'logic', 'response']); }; AuthorsPeter A.Tariche |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论