Guest User

Untitled

a guest
Feb 12th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. router.route('/').post((req, res) => {
  2. pool.query('INSERT INTO users SET ?', req.body, (err, result) => {
  3. if (err) throw err;
  4. res.status(201).send(`User added with ID: ${result.insertId}`);
  5. });
  6. });
  7.  
  8. curl -d "username=Dinesh Chugtai&email=dinesh@piedpiper.com&password=test" http://localhost:4000/users
  9.  
  10. curl -X POST 'http://localhost:4000/users?username=johnsmith&email=john@smith.com&password=password'
Add Comment
Please, Sign In to add comment