Skip to content

Repository files navigation

@typeservice/koa

codecov

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.

Installing

For the latest stable version:

$ npm install @typeservice/koa

Usage

importKoa,{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();

License

MIT

Copyright (c) 2019-present, yunjie (Evio) shen

About

It is a KOA-based service architecture that is fully compatible with all KOA ecosystems.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages