ah-server
TypeScript icon, indicating that this package has built-in type declarations

5.2.5 • Public • Published

ah-server

轻量可扩展的 web server

  • 基于 koa
  • Egg.js 体验
  • app、service、scheduler、context 模块

TL;DR

import { App, Service, IService, Config } from 'ah-helper';

class AService extends Service {
  foo() {
    this.service.b.bar();
  }
}
class BService extends Service {
  bar() {
    this.service.a.foo();
  }
}

class DemoApp extends App {
  service: IService = {
    a: new AService(this),
    b: new BService(this),
  };
}

const app = new DemoApp(new Config());
app.start().catch(() => process.exit(1));

Readme

Keywords

none

Package Sidebar

Install

npm i ah-server

Weekly Downloads

2

Version

5.2.5

License

none

Unpacked Size

28.5 kB

Total Files

24

Last publish

Collaborators

  • concefly