Is there a way to connect to a local redis server when using `@upstash/redis`?
See original GitHub issueI use @upstash/redis
in my vercel serverless functions. I can connect to the databases created in Upstash console.
Looks like the connection API is tailored to work wiht upstash redis server using http REST.
const redis = new Redis({ url: 'UPSTASH_REDIS_REST_URL', token: 'UPSTASH_REDIS_REST_TOKEN' });
I would also like to be able to connect to my local redis server for local development. I don’t really like the idea of sending requests over the network for local development. Using a different client for local development is not great either. So is there a way to run an upstash cluster in my local or connect to my local redis server using @upstash/redis
?
Eg. CockroachDB lets run their cluster locally in my machine so I don’t have to build local only abstractions to work with CockroachDB.
It’d be nice to have something similar while working with Upstash.
Issue Analytics
- State:
- Created a year ago
- Comments:12
Top GitHub Comments
Oh man I saw Go in their docs and mistook it for a go client. upstashdis is what I was looking for. Thanks for clearing it up @chronark and sorry about the confusion. 😀
As I said above, it is a wrapper around a running redis instance to expose an http server compatible with our API. It’s not just a client.
upstash-redis-rest-server --addr <ADDR> --redis-addr <ADDR> [--api-token <TOKEN>]
But I do see your point. We’ll discuss providing a first party redis wrapper internally.