1.0.0 • Published 12 months ago

tc-response-model v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months 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);
}