It is a KOA-based service architecture that is fully compatible with all KOA ecosystems, while providing dynamic Agent assistance processes and IPC communication mechanisms.
For the latest stable version:
$ npm install @typeservice/koaimportKoa,{Context}from'@typeservice/koa';interfaceCustomContextextendsContext{abc: number}constapp=newKoa<any,CustomContext>(9000);app.use(async(ctx,next)=>{ctx.abc=789;awaitnext();});app.use(async(ctx,next)=>{ctx.body='hello world, '+ctx.abc;awaitnext();});app.httpBootstrap();app.listen();You also can user messager
constapp=newKoa(9000);app.use(async(ctx,next)=>{ctx.abc=awaitctx.messager.invoke('xxxx','xxxx','xxxx');awaitnext();});app.httpBootstrap();app.listen();Copyright (c) 2019-present, yunjie (Evio) shen