Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.route('/').post((req, res) => {
- pool.query('INSERT INTO users SET ?', req.body, (err, result) => {
- if (err) throw err;
- res.status(201).send(`User added with ID: ${result.insertId}`);
- });
- });
- curl -d "username=Dinesh Chugtai&email=dinesh@piedpiper.com&password=test" http://localhost:4000/users
- curl -X POST 'http://localhost:4000/users?username=johnsmith&email=john@smith.com&password=password'
Add Comment
Please, Sign In to add comment