File tree Expand file tree Collapse file tree
lambda-elasticache-integrationpattern-cdk/lambda Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const redis = require ( "ioredis" ) ;
1+ const redis = require ( 'ioredis' ) ;
2+
23const client = new redis ( {
3- port : process . env . REDIS_PORT ,
4- host : process . env . REDIS_HOST ,
5- maxRetriesPerRequest : 20
6- } )
7- client . on ( 'connect' , function ( ) {
8- console . log ( 'connected' ) ;
9- } ) ;
10- exports . handler = async function ( event ) {
11- await client . set ( "foo" , "bar" ) ;
12- let result = await client . get ( "foo" ) ;
13- return {
14- statusCode : 200 ,
15- headers : { "Content-Type" : "text/plain" } ,
16- body : result
17- } ;
18- } ;
4+ port : process . env . REDIS_PORT ,
5+ host : process . env . REDIS_HOST ,
6+ maxRetriesPerRequest : 20 ,
7+ } ) ;
8+
9+ client . on ( 'connect' , function ( ) {
10+ console . log ( 'connected' ) ;
11+ } ) ;
12+
13+ exports . handler = async function ( event ) {
14+ await client . set ( 'foo' , 'bar' ) ;
15+ let result = await client . get ( 'foo' ) ;
16+ return {
17+ statusCode : 200 ,
18+ headers : { 'Content-Type' : 'text/plain' } ,
19+ body : result ,
20+ } ;
21+ } ;
You can’t perform that action at this time.
0 commit comments