-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |