types/serverless-tencent-scf/README.md
Tencent Cloud's Serverless Cloud Function (SCF) is a serverless execution environment that enables you to build and run applications without having to purchase and manage servers.
npm install --save-dev @types/serverless-tencent-scf
import { Handler } from 'serverless-tencent-scf';
interface CustomEvent {
hello: 'world';
}
interface CustomResult {
success: boolean;
}
type CustomHandler = Handler<CustomEvent, CustomResult>;
export const main: CustomHandler = (event, context, callback) => {
console.log(event.hello);
callback(null, { success: true });
};
import { APIGatewayHandler } from 'serverless-tencent-scf';
interface DemoResult {
code: number;
msg: string;
data?: any;
}
export const main: APIGatewayHandler<DemoResult> = async event => {
console.log(event.body);
return { code: 0, msg: 'success', data: [] };
};