Open benji1123 opened 1 year ago
I want the website to play cyberpunk themed music to immerse the viewer. I've already purchased and downloaded tracks from uppbeat that I'd like to use. To make these songs accessible to my website, I need to (A) store them somewhere (B) build a service to return them.
This website is hosted from a github repo as of today (April 2023), so the easiest solution is to push my songs here then play them:
const music = new Audio("$path-to-mp3-file");
music.play()
pros:
cons:
(The API shouldn't work for other people) Setup a API Gateway Lambda authorizer to only allow API calls from my domain name.
Pros:
Cons:
This is similar to Solution 2: AWS where my music-fetching service runs on a dyno for a fixed monthly-cost (~$5-10/month). There's no music storage solution here, so we'd still employ S3 for song storage and access it from our dyno like this.
Pros:
Cons:
My music files may be too large to send in one response. Read: https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/
Requirements
I'm using paid music (downloaded from uppbeat.io with my subscription), so the music file needs to be hidden from the public (to prevent ppl from downloading it) but accessible by my website
Alternatives:
Tech Questions
References