Last active
June 24, 2018 07:37
-
-
Save AndrejGajdos/938237a6adfff19a18ed579512455f74 to your computer and use it in GitHub Desktop.
Initializing Redis and adding one user into mock database. Whole file is available https://github.com/AndrejGajdos/auth-flow-spa-node-react/blob/master/script/server.js
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
// create mock database with one user | |
const db = redis.createClient(); | |
db.on('error', (err) => { | |
console.log(`Redis Error ${err}`); | |
}); | |
db.set('usersMockDatabase', JSON.stringify([ | |
{ | |
id: 1, | |
email: 'chouomam@chouman.com', | |
// "test" -- generated by bcrypt calculator | |
password: '$2a$04$4yQfCo8kMpH24T2iQkw9p.hPjcz10m.FcWmgkOhkXNPSpbwHZ877S', | |
userName: 'Chouomam', | |
}, | |
]), redis.print); | |
module.exports = { | |
db, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment