Skip to content

Commit 4ef9714

Browse files
committed
Update documentation with a tldr
1 parent a7891c4 commit 4ef9714

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
# SRH: Serverless Redis HTTP
2+
3+
---
4+
5+
**TLDR: If you want to run a local Upstash-compatible HTTP layer in front of your Redis:**
6+
7+
0) Have a locally running Redis instance - in this example bound to the default port 6379
8+
1) create a json file called tokens.json in a folder called srh-config (`srh-config/tokens.json`)
9+
2) paste this in:
10+
```json
11+
{
12+
"example_token": {
13+
"srh_id": "some_unique_identifier",
14+
"connection_string": "redis://localhost:6379",
15+
"max_connections": 3
16+
}
17+
}
18+
```
19+
3) Run this command:
20+
`docker run -it -d -p 8079:80 --name srh --mount type=bind,source=$(pwd)/srh-config/tokens.json,target=/app/srh-config/tokens.json hiett/serverless-redis-http:latest`
21+
4) Set this as your Upstash configuration
22+
```js
23+
import {Redis} from '@upstash/redis';
24+
25+
export const redis = new Redis({
26+
url: "http://localhost:8079",
27+
token: "example_token",
28+
});
29+
```
30+
---
31+
232
A Redis connection pooler for serverless applications. This allows your serverless functions to talk to Redis via HTTP,
333
while also not having to worry about the Redis max connection limits.
434

0 commit comments

Comments
 (0)