I like it but not that enthusiastic about JavaScript echoing html. What about having simple html templates that call back to the worker for the posts and the worker return json?
Show HN: A text-only blog engine using Cloudflare workers and KV store
41–50 of 54 posts
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#426 comments already complaining that this isn't "simple". I suggest we instead treat this post as if the title was "Show HN: a simple text blog demonstrating how to use Cloudflare workers and KV store" - that way we get to have a more interesting conversation.
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#43What is the pricing structure on this? I am sure there is a free-tier, but if we skip that and pretend we are paying for it from the beginning. How would much 100.000 hits be? I presume it would be a tiny number, A esp given the current content in the blog. so lets imagine some photos and heavier content. How difficult would it be to extend with with CF CDN?
For workers, free is 100k hits per day and 10ms of CPU per hit. KV is 100k reads, 1k writes, 1k deletes, 1k lists and 1GB storage. The subscription is 5 USD a month, including 10M hits at 30ms each, 10M w, 1M r, 1M d, 1M l, and also 1GB. One of the examples in their page (for a fully dynamic website, which is worst case) is: Subscription $5.00 Requests $1.50 (15,000,000 requests - 10,000,000 included requests) / 1,00…
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#44Earlier quoted context omitted.
You don't even need realtime. You can get away with just having people POST to a backend, updating a database and letting people refresh the page.
Why do all that when you could have the server write simple text files to the disk?
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#45Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#46Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#47Thought this was really cool, so I reimplemented[0] it in Val Town[1] using their blob storage[2]. Mine's a bit longer because of I got a little more elaborate but it was a fun exercise. [0] https://www.val.town/v/nbbaier/simpletext [1] https://www.val.town/ [2] https://docs.val.town/std/blob/
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#48Thought this was really cool, so I reimplemented[0] it in Val Town[1] using their blob storage[2]. Mine's a bit longer because of I got a little more elaborate but it was a fun exercise. [0] https://www.val.town/v/nbbaier/simpletext [1] https://www.val.town/ [2] https://docs.val.town/std/blob/
That's awesome, never heard of val town so I'm going to have a closer look.
Re: Show HN: A text-only blog engine using Cloudflare workers and KV store
#49Earlier quoted context omitted.
I'd have thought the SQLite database (D1) would be a more obvious fit for a blog?
Good point, I'm making my way through exploring more of CF so I'll likely try a D1 variant of this. Ta
I built this little service to add UK specific political location data to Action Network CRM. 300 lines for the actual service!
code here: https://github.com/jms301/ANUpdaterUK/blob/main/src/index.js
Sure it's only taking a webhook, reading an API, looking up a db entry and then updating via API.
But just knowing it's running on someone else's infra and there's so little code to validate is very comforting.
Prior to this I had a version running on a VPS and yeah I can do it. But you end up with a LOT of code / config to run the web server, the queue, the database... And any of that could be introducing bugs and security problems.