sav-koa-startkit

0.0.1 • Public • Published

sav-koa-startkit

startkit for savjs and koa2

框架使用

import Koa from 'koa'
import {Router} from 'sav-router'

let app = new Koa()
let router = new Router()

app.use(router.route())

app.listen(3000)

接口模块定义

class TestInterface {
  @conf('hello', 'world')
  test () {}
}

@gen({auth: true})
@impl(TestInterface)
  class Test {
  async test () {}
}

Test = {
  name: 'Test',
  props: {auth: true},
  actions: {
    test: {
      name: 'test',
      method: async test () {},
      middleware: [
        ['hello', 'world']
      ]
    }
  }
}

路由大模块

  • Api接口层
  • View页面视图层

Readme

Keywords

none

Package Sidebar

Install

npm i sav-koa-startkit

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • jetiny