Skip to content

Browser hot-reloading for Python ASGI web frameworks like FastAPI using arel

License

Notifications You must be signed in to change notification settings

ashleymavericks/browser-hot-reloading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser hot-reloading in FastAPI using arel


License: MIT

Implementaion of lightweight browser hot-reloading for Python ASGI web apps frameworks like FastAPI using arel


What is arel?

arel can be used to implement development-only hot-reload for non-Python files that are not read from disk on each request. This may include HTML templates, GraphQL schemas, cached rendered Markdown content, etc.

How does arel work?

arel watches changes over a set of files. When a file changes, arel notifies the browser (using WebSocket), and an injected client script triggers a page reload. You can register your own reload hooks for any extra server-side operations, such as reloading cached content or re-initializing other server-side resources.

Installation guide

  1. Clone the repo
git clone https://github.com/ashleymavericks/browser-hot-reloading.git
  1. Install dependencies
pipenv install

or

pip install -r requirements.txt
  1. Set environment variable in your shell instance
export DEBUG=True
  1. Verify it using
echo $DEBUG
  1. Test this implementation, and further include it in your projects for a better development experience with Python ASGI web frameworks

LICENSE

This project is licensed under the MIT license

About

Browser hot-reloading for Python ASGI web frameworks like FastAPI using arel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published