Last active
October 17, 2023 07:50
-
-
Save shaffeeullah/06f99a606642d110ff3aef29c42e3239 to your computer and use it in GitHub Desktop.
Use Cloud Storage signed URL with Express.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/', async (req, res) => { | |
// Get signed URL with action 'read' | |
const signedUrl = await getReadSignedUrl(bucketName, videoName, 10); | |
let output = `<video width="400" controls> | |
<source src=${signedUrl} type="video/mp4"> | |
</video>` | |
res.send(output); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment