Skip to content

webiscool/redis-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Redis-λ

Aim of this repo is to show how simple and swift it is to set up small APIs with AWS λ. Indeed λ service has HTTPS endpoints you can later on call with cUrl or fetch.

One must write short portions of code to store and retrieve datas. λ propose nodeJs or Python. (We chose nodeJs)

For the persistence nodeJs requires a redis client to communicate with a redis server one can find for free at redislabs

###This example is good way to set up "likes counter" in web apps

1 - To store a set with a value (Will return the number of hits for the pair)

curl -X POST -d '{"set":"days", "value":"tuesday"}' https://60zhqzqvuk.execute-api.us-west-2.amazonaws.com/prod/zincrby1

2 - To retrieve the set infos:

curl -X POST -d '{"set":"days"}' https://60zhqzqvuk.execute-api.us-west-2.amazonaws.com/prod/zrevrangebyscore

λ setup tuto

redis command info

examples using fetch in the browser or the server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published