I created a free redis database.
I had a lot of problems connecting from my node app.
The provided examples didn’t work.
What worked was following the examples on the github page of the node-redis client.
Now I can read and write to my redis database from my node app (running locally)
I also connected via the redis-cli with
fly redis connect
In my node app I have
const redisresult = await redisClient.set("test1", "test-value"); console.log("🚀 ~ file: server.js:18 ~ redisresult:", redisresult); let value = await redisClient.get("test1"); console.log("🚀 ~ file: server.js:21 ~ value:", value);
I get back the value I expect.
But when I use redis-cli to get the same key as in my node app I get nil
127.0.0.1:16379> get test1 (nil)
I was expecting to get test-value not nil.
What am I doing wrong or what do I not understand?