Skip to content

Commit

Permalink
✨ first public release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Cesar committed May 14, 2021
1 parent dc81b3c commit 0313e41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm install middy-idempotent -S

## Usage

Besides `@middy/core`, you must also use `@middy/http-json-body-parser` since this middleware will read the request body and needed parsed as json. And right now I only tested twith the client provided by the `ioredis` lib as well, so you'll need to install it too. At tthe bottom there's a write-up where we'll find how to use a Serverless Database service called [Upstash](https://upstash.com/) for free that is currently (`0.0.18`) the only storage supported.
Besides `@middy/core`, you must also use `@middy/http-json-body-parser` since this middleware will read the request body and needed parsed as json. And right now I only tested twith the client provided by the `ioredis` lib as well, so you'll need to install it too. At tthe bottom there's a write-up where we'll find how to use a Serverless Database service called [Upstash](https://upstash.com/) for free that is currently (`0.0.20`) the only storage supported.

```ts
handler.use(jsonBodyParser()).use(
Expand All @@ -60,7 +60,7 @@ Note that the optional targets are mutually excludents, they obey the hierarchy

## 📚 Read more

- [Redis: Exploring Redis as Serverless Database to solve idempotence in APIs]()
- [Redis: Exploring Redis as Serverless Database to solve idempotence in APIs](https://dev.to/aws-builders/redis-exploring-redis-as-serverless-database-to-solve-idempotence-in-apis-2gma)

## See Also

Expand Down
4 changes: 2 additions & 2 deletions demo/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export class ApiStack extends cdk.Stack {
code: new lambda.AssetCode(path.resolve(__dirname, "dist")),
handler: `index.${config.api.handler}`,
runtime: lambda.Runtime.NODEJS_14_X,
description: "An lambda to test",
description: "A lambda to test",
tracing: lambda.Tracing.ACTIVE,
environment: {
UPSTASH_REDISS:
"rediss://:[email protected]:33404",
"",
},
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "middy-idempotent",
"version": "0.0.19",
"version": "0.0.20",
"description": "An Idempotent Middleware for Middy",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down

0 comments on commit 0313e41

Please sign in to comment.