import o from"debug";import n from"koa";import s from"koa-compose";var t=o("@tomrpc/core/plugin"),r=class{constructor(e){this.init=[];this.load=[];this.config=Object.assign({bind:{}},e),this.name="base",this.app=new n,this.init=[],this.load=[],this.prefix=this.config.prefix?this.config.prefix:"",this.compose=s,this.load.push(this.getMiddleware())}getConfig(e){return e[this.name]}getMiddleware(){let e=this.pre(),i=this.process(),p=this.post();return s([e,i,p])}pre(){return async(e,i)=>{t("pre"),await i(),t("pre end")}}post(){return async(e,i)=>{t("after"),await i(),t("after end")}}process(){return async(e,i)=>{t("process default"),await i(),t("process default end")}}use(e){this.app.use(e)}addInit(e){this.init.push(e)}addLoad(e){this.load.push(e)}};export{r as a};
//# sourceMappingURL=chunk-GD7WKZ3L.mjs.map