iqy-server
v0.2.5
Published
a web framework by koa and typescript
Downloads
8
Maintainers
Readme
iqy-server
Read Doc
a koa and typescript based web framework
- iqy-cli 脚手架支持 使用脚手架快速创建项目,全局安装脚手架。脚手架地址
npm install iqy-cli -g
so init
- Quick Start
npm install iqy-server --save
// index.ts
import SoServer from 'iqy-server'
const server: SoServer = new SoServer()
server.Listen(12280)
// test.controller.ts
import {SoController,Controller, Get,Autowired} from 'iqy-server'
import { TestService } from './test.service'
@Controller('/')
export class TestController extends SoController {
@Autowired
private testService: TestService
@Get('/')
async name(){
this.ctx.body = 'hello iqyserver'
}
}
// test.service.ts
import {SoService,Service } from 'iqy-server'
@Service
export class TestService extends SoService {
async query(): Promise<string>{
return "aaa"
}
}
- Run
ts-node index.ts
Plugin
eslint and prettier for iqyserver
mysql for iqy-server