Skip to content

Commit

Permalink
update reamdes
Browse files Browse the repository at this point in the history
  • Loading branch information
adnaan committed Mar 29, 2024
1 parent cbaa132 commit aed4bd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Fir sits somewhere between [Phoenix Liveview](https://github.com/phoenixframewo
- **Interactivity over standard HTTP**: Fir possesses a built-in pubsub over websocket capability to broadcast UI diff changes to connected clients. However, it doesn't solely rely on websockets. It's still possible to disable websockets and benefit from UI diffs sent over standard HTTP.
- **Broadcast from server**: Broadcast page changes to specific connected clients.
- **Error tracking**: Show and hide user specific errors on the page by simply returning an error or nil.
- **Development live reload**: HTML pages reload automatically on edits if development mode is enabled


## Usage
Expand Down
18 changes: 18 additions & 0 deletions examples/chirper/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Chirper: a simple real-time twitter clone

The example demonstrates: progressive enhancement, form validation and real-time changes.

## Start without javascript
[index_no_js.html](./index_no_js.html) is a plain html file which is handled by the route function [NoJSIndex](index.go#NoJSIndex). See it in action:

```
go run .
open http://localhost:9867/nojs
```

The above page works even if javascript is disabled in the browser.

## Enhance with the alpinejs client

[index.html](./index.html) is an html file with javascript sprinkled using the alpinejs client. It is handled by the route function [Index](index.go#Index). See it in action:

```
open http://localhost:9867
```

Open two tabs at: http://localhost:9867. Add a chirp in one and see it broadcasted to the second tab instantly.

0 comments on commit aed4bd5

Please sign in to comment.