0.0.1 • Published 7 years ago

sav-koa-startkit v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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页面视图层