@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) • 495 B
JavaScript
import { StatusCodes } from 'http-status-codes';
import { Success } from './Success.js';
export class Created extends Success {
static format(extra) {
return {
statusCode: 201,
headers: {
'content-type': 'text/plain'
},
body: extra || 'Created',
};
}
constructor(message, statusCode) {
super(message);
this.statusCode = statusCode;
this.statusCode = StatusCodes.CREATED;
}
}