---
title: "💭 florimondmanca/arel: Lightweight browser hot reload for Python..."
description: "!https://github.com/florimondmanca/arel"
date: 2023-10-08
published: true
tags:
  - webdev
  - fastapi
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://github.com/florimondmanca/arel" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://opengraph.githubassets.com/975747e1fee22d14df94a20ee68180dc2c8d3368973060990f32c1101fed606a/florimondmanca/arel" alt="GitHub - florimondmanca/arel: Lightweight browser hot reload for Python ASGI web apps — Lightweight browser hot reload for Python ASGI web apps - florimondmanca/arel" loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">GitHub - florimondmanca/arel: Lightweight browser hot reload for Python ASGI web apps</div>
      <div class="embed-card-description">Lightweight browser hot reload for Python ASGI web apps - florimondmanca/arel</div>
      <div class="embed-card-meta">GitHub &middot; github.com</div>
    </div>
  </a>
</div>


arel is a "Lightweight browser hot reload for Python ASGI web apps"

I just implemented this on my thoughts website using fastapi, and it's incredibly fast and lightweight.  There just two lines of js that make a web socket connection back to the backend that watches for changes.


When in development mode, this snippet gets injected directly on the page and does a refresh when arel detects a change.

``` js
const ws = new WebSocket("ws://localhost:5000/hot-reload");
ws.onmessage = () => window.location.reload();
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
