News for hackers. Stuff that matters.
Re:Ask HN: Show me your half baked project by gwph on Saturday January 09, 2021 @10:23AM (#25701043)
https://lofichess.com

I wanted a trimmed down interface for following live chess streams. To keep the website updated I run an AWS Lambda every two minutes that does the following:

1. Pulls active streams from the Twitch API.

2. Uses the Go templates library to repackage the response as static HTML.

3. Uploads the static HTML to S3, where it is served behind CloudFront.

Re:Ask HN: Show me your half baked project by woutr_be on Saturday January 09, 2021 @10:52AM (#25701337)
Interesting approach to generate a static website. Is this completely free? Or do you end up paying for the Lambda task?
Re:Ask HN: Show me your half baked project by gwph on Saturday January 09, 2021 @11:27AM (#25701669)
Average latency for the Lambda over the last week is 4.84s and it runs with 128mb of memory. Running every two minutes, that comes to ~25,000 invocations and ~15,000 GB-seconds of compute time per month. The AWS Lambda free usage tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month so the Lambda is definitely free.

The website is tiny (homepage < 20kb excluding the thumbnails which are hosted by Twitch), so I'm also inside the free tier on S3 and CloudFront. I paid $12 upfront for the domain registration.

Re:Ask HN: Show me your half baked project by woutr_be on Sunday January 10, 2021 @01:13AM (#25711240)
Thanks for the explanation. I was thinking about how I would do it, but always ended up reverting to Netlify. Good to have some different approaches.