Skip to content

southorange0929/fayjs

Repository files navigation

Fay.js

GitHub starsnpmGitHub forksGitHub issuesnpmGitHub license

a koa and typescript based web framework

  • iqy-cli 脚手架支持 使用脚手架快速创建项目,全局安装脚手架。脚手架地址
npm install iqy-cli -g

so init
  • Quick Start
npm install fayjs --save
// index.ts
import Fayjs from 'fayjs'

const server: Fayjs = new Fayjs()

server.Listen(12280)
//  test.controller.ts
import { BaseController, Controller, Get, Autowired } from 'fayjs'
import { TestService } from './test.service'
@Controller('/')
export class TestController extends BaseController {

  @Autowired
  private testService: TestService

  @Get('/')
  async name(){
    this.ctx.body = 'hello Fayjs'
  }
}
//  test.service.ts
import { BaseService,Service } from 'fayjs'

@Service
export class TestService extends BaseService {
  async query(): Promise<string>{
    return "aaa"
  }
}
  • Run
ts-node index.ts

Plugin

About

a web framework by koa and typescript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published