Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.post('/users', async (req, res) => {
- console.log(req.body);
- const user = req.body;
- console.log(user);
- try {
- const password = await bcrypt.hash(user.password, 10);
- user.password = password;
- const newUser = await knex('users').insert({ user }, '*');
- res.json(newUser);
- } catch (err) {
- res.status(user ? 500 : 400)
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement