Skip to content

Commit e9a9262

Browse files
committed
chore: updated route to call out using fetch
1 parent 3fb2ffa commit e9a9262

File tree

3 files changed

+76
-92
lines changed

3 files changed

+76
-92
lines changed

simple-express-app/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ const lib = require('@aws-sdk/client-sns')
55
const sns = new lib.SNSClient()
66

77
app.get('/named-route', (req, res) => {
8-
res.send('hi')
8+
fetch('https://requestbin.myworkato.com/1hisp3d1', {
9+
method: 'POST',
10+
headers: {
11+
'Content-Type': 'application/json'
12+
},
13+
body: Buffer.from(`{"fizz":"buzz"}`)
14+
})
15+
.then((response) => {
16+
return response.text()
17+
}).then((data) => {
18+
res.send(data)
19+
})
920
})
1021

1122
app.get('/sns', async (req, res) => {

simple-express-app/package-lock.json

Lines changed: 63 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

simple-express-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"bluebird": "^3.7.2",
1414
"body-parser": "^1.20.2",
1515
"express": "^4.18.2",
16-
"newrelic": "^11.10.2"
16+
"newrelic": "^11.17.0"
1717
}
1818
}

0 commit comments

Comments
 (0)