Releases: Albert-Gao/micro-aws-lambda
Releases · Albert-Gao/micro-aws-lambda
v5.3.3
v5.3.2
- Now JS error will be returned as 500 response
v5.2.2
fix: now log config will not throw on HTTP API
tweak: minor tweaked internal implementation
v5.2.0
- Added:
HttpResponse.error()
HttpResponse.badRequest()
HttpResponse.unauthorized()
HttpResponse.forbidden()
HttpResponse.notFound()
HttpResponse.methodNotAllowed()
HttpResponse.notAcceptable()
HttpResponse.conflict()
HttpResponse.internalError()
HttpResponse.notImplemented()
HttpResponse.badGateway()
HttpResponse.serviceUnavailable()
HttpResponse.gatewayTimeout()
HttpResponse.networkAuthenticationRequire()
- Removed:
success
is not directly exported now, please useHttpResponse. success
badRequest
is not directly exported now, please useHttpResponse. badRequest
httpError
is not directly exported now, please useHttpResponse.error
internalError
is not directly exported now, please useHttpResponse. internalError
v5.1.5
- feat: added
unauthorized()
andnotFound()
- Either
HttpResponse.unauthorized()
or importunauthorized
directly
v5.1.2
- feat: make success(), badRequest() and interError() more easier to call
now you can just success({name: 'albert'})
, a HTTP 200 with HTTP body {name:'albert'}
will be returned
If you want to change the statusCode
and headers
, you can add an 2nd parameter when invoking like:
success({name:'albert'}, {statusCode: 201, headers: { hidden: 1 }})
v5.1.0
- Swapped the
Shared
andResponse
in theMiddleware
type, so if you do not want to type check Response, no need to passany
- Updated the Middleware to
APIGatewayProxyHandlerV2
from@types/aws-lambda
, If you are using the Lambda Proxy mode, please importMiddlewareLegacy
, otherwise,
v5.0.1
fixed: Typescript error
tweaked: HttpResponse.httpError
is now HttpResponse.error
doc: updated Readme.md
BREAKING CHANGE
passDownObj
has renamed toshared
return
in a middleware STOPS the execution now, likethrow
, makes the flow easier to reason about!- all http helpers can be used under
HttpResponse
, just import this one alone