Adding Simple Routing to Cloudflare Workers

I’ve been "playing" with serverless for years now, but honestly still feel new to it. When it comes to organization in a project that uses serverless functions, I’ve typically tried to build one function per operation. So for example, if I had a need to get a list of cats, I’d have one function. If I had a need to get information about a cat based on an identifier, I’d probably build a second one. That being said, I recently came across an example Cloudflare function that did something cool – it used a router, specifically the very lightweight itty-router. Let me share an example of how it works. What is a Router? # So I kinda assume most folks know what... more →
Posted in: JavaScript

A Simple Slideshow Web Component

As I continue to play around with and learn more about web components, I thought I’d build a simple component to make it easier to add a slideshow. By that, I mean something that renders one picture but provides controls to go to more images. I’ve probably built this many times in the past, both in JavaScript and server-side code, and I thought it would be a nice candidate for a component. As with most of my demos so far, there’s a lot more that could be done with it, but I thought I’d share what I have so far. Once again I want to give a shout-out to Simon MacDonald for helping me get this code working. (At the end of the post, I’ll share the mistake I made, as... more →
Posted in: JavaScript