Skip to content

Commit

Permalink
fix custom endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jun 11, 2024
1 parent 6a61f67 commit e6f88c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions examples/aws-nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ app.get('/s3/sts', (req, res, next) => {
})
}, next)
})
app.get('/s3/params', (req, res, next) => {
const signOnServer = (req, res, next) => {
// Before giving the signature to the user, you should first check is they
// are authorized to perform that operation, and if the request is legit.
// For the sake of simplification, we skip that check in this example.
Expand All @@ -132,7 +132,9 @@ app.get('/s3/params', (req, res, next) => {
})
res.end()
}, next)
})
}
app.get('/s3/params', signOnServer)
app.post('/s3/sign', signOnServer)

// === <S3 Multipart> ===
// You can remove those endpoints if you only want to support the non-multipart uploads.
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-nodejs/public/withCustomEndpoints.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h1>AWS upload example</h1>
}

// Send a request to our Express.js signing endpoint.
const response = await fetch('/s3/sign-s3', {
const response = await fetch('/s3/sign', {
method: 'POST',
headers: {
accept: 'application/json',
Expand Down

0 comments on commit e6f88c4

Please sign in to comment.