Closed seho-dev closed 2 years ago
import { useApi, Get, Post } from '@sword-code-practice/sword-framework'; import { ReqQuery, ReqParams, Res } from './proto'; export const main = useApi<{ query: ReqQuery; params: ReqParams; res: Res; }>({ instruct: [Get(), Post()], handler: (ctx) => { return { message: 'hello' }; } });
等待pr合并:https://github.com/unjs/h3/pull/92