- Your brain!
- No more than one page (front and back) of hand written notes
- The Debugger. Please run and debug your code
- The general internet
- Other students
- Any prepared materials (besides notes)
- Any lessons
- Any solution code from any lab, whether you wrote it or Flatiron School did
- Code from any lecture
- Clone this repo down (don't fork!)
- Create and checkout a branch before you start coding:
git checkout -b "your-name"
This code challenge can be broken down into 7 steps. It is recommended that you commit after each step:
- Get messages by requesting it from the server
- Create a
Message
class, and use it to render each of the messages in a list - Listen for when a user tries to add a new message
- When a user makes a message, Render the new message in the message list without refreshing the page
- When a user makes a message, Send the message to the server so that it persists
- Use
setInterval
to re-request the messages every 500 ms and re-render them in the list - Refactor your code to make it as clean as possible
The endpoint for getting image looks like this:
GET 'http://10.185.1.104:3000/messages'
Example Response:
[
{
"id": 1,
"content": "Hello Houston Codeo!"
}
]
If you cannot get your fetch request to work correctly, you can use the example response above to append content to the DOM and attempt the subsequent steps
POST 'http://10.185.1.104:3000/messages'
Required keys in the body of the request:
{
content: (insert message content here)
}
Required Headers
{
'Accept': 'application/json',
'Content-Type': 'application/json'
}
git add .
git commit -m "complete"
git push