Skip to content

Commit

Permalink
Merge branch 'copy-push-files-action-9651867272-upload-functions' int…
Browse files Browse the repository at this point in the history
…o development
  • Loading branch information
mongodb-atlas-app-services[bot] committed Jun 24, 2024
2 parents 5477c63 + e0a7a6c commit e03cd3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions snippets/functions/api-functions/api_callExternalAPI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports = async function(arg){
const url = "https://api.stackexchange.com/2.3/answers?key=U4DMV*8nvpm3EOpvf69Rxw((&site=stackoverflow&page=1&pagesize=10&order=desc&sort=activity&filter=default";

const response = await context.http.get({ url: url })
// The response body is a BSON.Binary object, so parse it:
const result = EJSON.parse(response.body.text())
// console.log(JSON.stringify(result));
return result;
}

0 comments on commit e03cd3e

Please sign in to comment.