Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var user = {
- username: 'test_user',
- email: 'test@test.me',
- password: 'you shall not pass',
- address: 'No where street'
- };
- chai.request(app)
- .post('/api/v1/users')
- .send(user);
- router.post('/', function(req, res, next) {
- console.log('body: ' + req.body);
- queries.insertUser(req.body)
- .then(function(id) {
- return queries.getSingleUser(id);
- })
- .then(function(user) {
- res.status(200).json(user);
- })
- .catch(function(err) {
- next(err);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement