Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/signup', (req, res) => {
- const { username, password } = req.body;
- const saltRounds = 10;
- bcrypt.hash(password, saltRounds, function (err, hash) {
- db.user.create({
- username: username,
- password: hash
- }).then((result) => {
- console.log("User created: ", result);
- res.json("user created!");
- })
- });
- })
Add Comment
Please, Sign In to add comment