Introduction I developed Simple Cloudflare Comments to fulfil the need I had for a lightweight, edge-hosted comments engine. It’s written in Typescript and runs on Cloudflare’s edge …
As part of a class assignment, I got a little bit of time to work on a code project of my choosing.
This site is already hosted as a “Cloudflare Page” which is their awesome, effectively free (at my scale), CDN-backed hosting mechanism. A few weeks ago cloudflare announced that their D1 database product was now available (in alpha) to all customers.
I set about building a cloudflare plugin that can (sort of) easily be added to any site. I need to figure out more documentation on the exact process to deploy this, but you can check out the code at github.com/grahamsz/simple_cloudflare_comments.
I had a few requirements as I set out on this
- Should be fast. I’m pretty obsessive about my site load times, and don’t want adding of a feature that most people won’t use to impact that significantly
- Should support markdown. I ended up using Marked to handle the conversion to html
- Should support pluggable authentication. Right now it only uses Google, but the backend uses Cloudflare Worker Auth Providers which should make it easy to add more choices
- Should integrate WebMentions. Right now it does this by hitting webmention.io but I think it’d be a nice addition to capture those directly and store them in the D1 database alongside comments
Scroll down, they should be right here. Hopefully!