Something went wrong. Try again.
My #100DaysOfCode Challenge starting today! This repository is to dump most of the scrap/test project works done during the challenge.
Something went wrong. Try again.
1234567891011121314151617181920212223const { create } = require("./user.service")const { genSaltSync, hashSync } = require('bcrypt');
module.exports = { createUser: (req, res) => { const body = req.body; const salt = genSaltSync(10) body.password = hashSync(body.password, salt) create(body, (err, results) => { if (err) { console.log(err); return res.status(500).json ({ success : 0, message : 'Database Connection Error' }); } return res.status(200).json({ success : 1, data : results }) }); }}