parent
9083eaad9e
commit
a92828c166
@ -0,0 +1,18 @@
|
||||
import { createClient } from 'redis';
|
||||
|
||||
const client = createClient({
|
||||
password: process.env.REDIS_PWD,
|
||||
socket: {
|
||||
host: 'redis-11789.c329.us-east4-1.gce.redns.redis-cloud.com',
|
||||
port: 11789
|
||||
}
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
console.log('connected');
|
||||
//await client.set('foo', 'bar');
|
||||
const value = await client.get('foo');
|
||||
console.log(value) // returns 'bar'
|
||||
|
||||
await client.disconnect();
|
||||
|
||||
Loading…
Reference in new issue