Skip to content

Commit 166c64b

Browse files
committed
testing
1 parent 25ae1dd commit 166c64b

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

netlify-functions/getTweets.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
const axios = require('axios');
22

33
exports.handler = async (event, context, callback) => {
4-
4+
console.log("Inside the twitter lambda function");
55
try{
6+
7+
console.log("Inside try block");
8+
69
const TwitterApi = axios.create({
710
baseURL: "https://api.twitter.com/1.1",
811
headers: {
@@ -12,8 +15,14 @@ exports.handler = async (event, context, callback) => {
1215

1316
TwitterApi.get("/statuses/user_timeline.json?screen_name=codeuino&count=200&tweet_mode=extended")
1417
.then(allTweetsResponse => {
18+
19+
console.log("Inside then for first API call");
20+
1521
TwitterApi.get("/favorites/list.json?count=200&screen_name=codeuino")
1622
.then(likedTweetsResponse => {
23+
24+
console.log("Inside then for second API call");
25+
1726
callback(null, {
1827
statusCode: 200,
1928
headers: {
@@ -25,10 +34,23 @@ exports.handler = async (event, context, callback) => {
2534
})
2635
})
2736
})
28-
.catch(err=>console.log(err))
37+
.catch(err=>{
38+
39+
console.log("Inside catch for second API call");
40+
41+
console.log(err)
42+
})
43+
})
44+
.catch(err=>{
45+
46+
console.log("Inside catch for first API call");
47+
48+
console.log(err)
2949
})
30-
.catch(err=>console.log(err))
3150
} catch(err) {
51+
52+
console.log("Inside catch block");
53+
3254
console.log(err);
3355
}
34-
}
56+
}

0 commit comments

Comments
 (0)