node redis
any hacks to connect to redis on node? ive slept the 5s but still conn refused
Solution:Jump to solution
after just looking at the docs, you are using the library incorrectly, please read the docs
https://www.npmjs.com/package/redis#usage...
23 Replies
Project ID:
N/A
N/A
please show the error.
are you trying to connect to the database via public or private networking?
what library are you using?
anything else you think may be useful information
i'm using the official node-redis client and conecting via private networking
rn im just doing sleep 5 && runcommand lol
please show the error
Error: connect ECONNREFUSED ::1:6379
show the code that initialises the connection please
have you confirmed that REDIS_URL is the correct value
yes its an env var
which i set in the dashboard
imma try via public netwk
from this error, it looks like it's trying to connect to localhost, and port 6379, Which is the default when you don't supply the correct information to the connect constructor
nope not it
yeah i know because of the ipv6 loopback addr lol
i checked that but the env var is set
that's not it, you're thinking of something that's doesn't apply here
please confirm your code is seeing the proper redis url
can you also show me how you have set the
REDIS_URL
in codeyes the app has access to the variable
the REDIS_URL is the value from destructuring process.env
have you printed that variable to confirm it's correct value?
yup
okay i will try to reproduce
Solution
after just looking at the docs, you are using the library incorrectly, please read the docs
https://www.npmjs.com/package/redis#usage
what do you mean wrong
please read the docs
youre right
yea now it makes sense
sorry abt that
it was defaulting to localhost because i wasnt passing the url in the right method
correct
thanks! and sorry for such a stupid mistake