tc-response-model
v1.0.0
Published
Response model used in Track Cargo
Downloads
1
Maintainers
Readme
Track Cargo Response Model
My awesome module
Install
npm install tc-response-model
Usage
import { ApiResponse, ApiSuccessResponse } from 'tc-response-model';
// Sending success response
const apiSuccess: ApiSuccessResponse<string> =
new ApiSuccessResponse<string>('Hello World', 'Data description');
return ApiResponse.send(apiSuccess, []);
// Sending error response
try {
// ...your code here
} catch (e) {
// ...your Error handler here
// ...
return ApiResponse.send(e);
}