Skip to content

sgbasaraner/http-status-codes-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-status-codes-lambda

A thin wrapper over http-status-codes library. It's useful for returning default errors.

import { defaultResponse, StatusCodes } from 'http-status-codes-lambda';

const expectedResponse = {
    statusCode: 500,
    body: JSON.stringify({
        error: 'Internal Server Error'
    })
}

console.log(defaultResponse(StatusCodes.INTERNAL_SERVER_ERROR))
// { statusCode: 500, body: '{"error":"Internal Server Error"}' }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published