Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/add-users', function (req, res) {
- var success = [];
- var count = 0;
- users.forEach(function(user, i){
- request({
- url: url,
- method: 'POST',
- json: true
- }, function(err, resp, body){
- if (!err && resp.statusCode === 200) {
- success.push('user added');
- }
- });
- if(count === users.length) {
- res.json(success);
- }
- });
- });
Add Comment
Please, Sign In to add comment