0.0.5 • Published 4 years ago
fayjs v0.0.5
Fay.js
Read Doc
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
eslint and prettier for iqyserver
mysql for iqy-server