Simple Blog Example in Flask

As part of my efforts to improve my Python knowledge, I’ve been looking at the Flask framework for a way to build Python-backed web apps. I’ve only been looking at it for a short time, but I’m really impressed with how simple it is. In some ways, it reminds me a lot of when I first saw Express. Before that, I wasn’t sure I was going to like Node.js as it felt like a lot of work to build a simple app, but Express handled a lot of the boring parts. The same applies to Flask. To get an idea of how easy it is, here’s the basic "hello world" from the quickstart: from flask import Flaskapp = Flask(__name__)@app.route("/")def hello_world(): return... more →
Posted in: JavaScript

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