1.0.0 • Published 2 years ago

tc-response-model v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Track Cargo Response Model

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

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);
}