Install Erlang and Elixir on Debian

I’ve started learning Elixir and wanted to share the steps for reinstalling it in Debian (well, crostini on my chromeos installation but it should be the same for regular Debian too.)

Now these steps are pretty much verbatim if you follow the official Elixir, asdf and asdf-{erlang,elixir} documentation but I want to make sure I have this saved for myself in the future and anyone else who stumbles upon this.

# First start with getting asdf installed

asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

# Add asdf to your .bashrc and restart your terminal

. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"

# Next install the Erlang plugin pre-reqs

apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

# Install the Erlang asdf plugin and Erlang

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang 25.2.2 # The latest version as of this article

# Install Elixir asdf plugin and Elixir

asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.14.3-otp-25 # The latest as of this article

Cloudflare Workers - Routing Made Easy

Hi, just wanted to share something cool I found while working on a side project using Cloudflare Workers. It’s called itty-router-openapi and it’s from Cloudflare themselves.

I’ve been working on a globally distributed server provisioning platform using Cloudflare’s compute (Workers) and storage (KV, R2, Durable Objects.) As part of the API portion of this work, I first rolled my own naive implementation of endpoint routing to get things off the ground. After building up the service further it, was becoming apparent that I would need a proper routing framework.

I first started working on my own framework but that quickly turned into something I really didn’t want to dig into and I (correctly) assumed that this had been solved somewhere else first. The first thing I landed on was itty-router. It’s a micro routing framework that works with Javascript and TypeScript that seemed to fit the bill perfectly for what I needed.

I started rewriting my endpoints using this framework. As I was running into issues, I started searching around for additional documentation or sites when I stumbled upon itty-router-openapi. Seeing that it was intended for use with Workers, been used in production for Cloudflare Radar and had the added support for OpenAPI, I was instantly sold.

I’ve only now started the third re-write using this new library. So far it has been going pretty good but I will try to update soon on how things are going and if I’m still using the framework.