Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(var i = 0; i <= 1 ; i++){
- apiRequest = data[i];
- apicall(apiRequest);
- }
- function apicall(urlApi){
- request((urlApi), function(error, response, body){
- if(error){
- console.log("error");
- } else if(!error && response.statusCode == 200){
- var myobj = JSON.parse(body);
- dbInsert(myobj);
- }
- });
- }
- function dbInsert(obj) {
- //insert into database
- }
Add Comment
Please, Sign In to add comment