---
title: "florimondmanca/arel: Lightweight browser hot reload for Python..."
description: "!https://github.com/florimondmanca/arel"
date: 2023-10-08
published: true
tags:
  - dev
  - fastapi
  - python
  - thought
  - webdev
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/ee210b14022ec500864b07757bc74c910f9540d7df2ac7e6b235257a25293409/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();
```
