koa2-rest-cli
Version:
A RESTFul API generator for Koa2
24 lines (18 loc) • 616 B
text/typescript
import { JsonController, Get, Post, QueryParam, BodyParam } from 'routing-controllers'
import HelloService from '../services/hello'
import { Inject } from 'typedi'
export default class HelloController {
service: HelloService
async hello ( name: string) {
const message = await this.service.getGreetingString(name)
return message
}
async info ( optr1: number, optr2: number) {
const result = await this.service.getArithmeticResult(optr1, optr2)
return result
}
}