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

1.1.0 • Public • Published

CiviApp

是一个基于KOA的后端服务框架,接口和文件目录上参考了thinkjs

run 运行

const path = require('path')
const Application = require('civiapp')

// 创建实例
const instance = new Application({
  ROOT_PATH: process.cwd(),
  APP_PATH: path.join(process.cwd(), 'src'),
  RUNTIME_PATH: path.join(process.cwd(), 'runtime'),
  env: 'development',
  // env: 'production' // 生产环境
})

// 启动服务
instance.start()

Controller 控制器

module.exports = class extends civi.Controller {
  async indexAction () {
    return this.display()
  }
}

Readme

Keywords

Package Sidebar

Install

npm i civiapp

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

12.9 kB

Total Files

4

Last publish

Collaborators

  • yohann