@moside/moside
TypeScript icon, indicating that this package has built-in type declarations

0.6.1-a • Public • Published

MoSide - Web Controller

高效、简洁的Node网络控制器框架

UNSTABLE 不稳定
此项目目前仅用于某些内部项目,特性不稳定

开发目标

  1. 控制器规范化的编写风格。
  2. 稳定可靠的Node网络控制器框架。
  3. MoSide只关注控制器层。
  4. MoSide可以结合流行的网络框架使用,如:KoaJs \ ExpressJs。

提供以下特性/功能

  • 控制器注入
  • 控制器插件
  • Receiver接收器(提供类型匹配筛选)

example 实例

见example/index.ts

npm i
npm run dev

然后 ->_-> http://localhost:8081

简洁的控制器风格

在Moside中,推荐使用ES6 class风格进行编写。

@Controller({
  path: '/'
})
export class HomeController {
  @PluginA('...')
  @PluginB('...')
  @Get('/')
  index(res: MoResponse) {
    res.body({
      message: 'hello world'
    })
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @moside/moside

Weekly Downloads

0

Version

0.6.1-a

License

MIT

Unpacked Size

57 kB

Total Files

84

Last publish

Collaborators

  • yskun