UNPKG

@mikeycoxon/aws-lambda-event-http-router

Version:

AWS Lambda handler utility for HTTP REST request routing based on details in the APIGatewayProxyEvent

19 lines (18 loc) 480 B
import { StatusCodes } from 'http-status-codes'; import { Success } from './Success.js'; export class OK extends Success { static format(extra) { return { statusCode: 200, headers: { 'content-type': 'text/plain' }, body: extra || 'OK', }; } constructor(message, statusCode) { super(message); this.statusCode = statusCode; this.statusCode = StatusCodes.OK; } }