Skip to content

Instantly share code, notes, and snippets.

@deian
Last active December 19, 2015 08:09
Show Gist options
  • Save deian/5923678 to your computer and use it in GitHub Desktop.
Save deian/5923678 to your computer and use it in GitHub Desktop.
Chat app description
deian.net/hails-tutorial.html
<iframe src="/messages#last"></iframe>
---------------------------------------------
GET /message |^| --> get all from DB
| | find + next
| | --> html refresh 2; + list messages
| | --> #last
| |
| |
| |
| |
| |
| |
| |
| |
| |
- sam: what the heck? | |
<li id="last"> deian : w00t w00t </li> |v|
---------------------------------------------
--------------------------------------------|
GET /message/new | --> POST /message: insert DB
| --> redir /message/new
sam: [ ] [send] |
|
--------------------------------------------|
Goal: have an interactive chat (html-only implementation)
The first iframe should display _all_ the posted messages, always
scrolling to the bottom and refreshing every 1-2 seconds.
The second iframe should take user input. It should post the message
to the chat (write to DB) and redirect back so that the user can type
another message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment