Guest User

Untitled

a guest
Aug 16th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. app.post('/signup', (req, res) => {
  2. const { username, password } = req.body;
  3. const saltRounds = 10;
  4. bcrypt.hash(password, saltRounds, function (err, hash) {
  5. db.user.create({
  6. username: username,
  7. password: hash
  8. }).then((result) => {
  9. console.log("User created: ", result);
  10. res.json("user created!");
  11. })
  12. });
  13. })
Add Comment
Please, Sign In to add comment