Created
March 11, 2020 09:24
-
-
Save kylemocode/5459496df845a8e61bce035cbda8fbf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class RedisDatabase { | |
redis: any; | |
constructor() { | |
this.redis = require('redis'); | |
} | |
connectDB() { | |
const client = this.redis.createClient({ | |
host: '127.0.0.1', | |
port: 6379 | |
}); | |
client.on("error", (err: string) => { | |
console.log("Error " + err); | |
}); | |
client.on("ready", (err: string) => { | |
console.log("DB Ready"); | |
}); | |
return client; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment