AJAX requests are just HTTP requests - the server doesn't even know the difference. We can make GET or POST requests and
send data to the server in the URL or the POST body.
Unlike before, we won't be using an HTML form to generate the POST request with key-value encoding. We will be making an
AJAX request using fetch, and sending along data from JavaScript encoded as JSON.
Client-side code for this part will be put in the linked file quotes.js.
On every user keystroke in the search box, use AJAX to update the list of quotes. An empty search box should return nothing (as opposed to everything).
On the client:
Hook an event handler on the search box for every user keystroke
On every event, use fetch to retrieve /quote_search_test as JSON
When the data returns, clear the list of quotes and re-add the ones that were retrieved (just like part 2)
Change the AJAX GET query to a POST and send the search box contents in the POST body. This will break it, as there is no POST route to respond. Use the network panel to make sure your POST is sending the right data and then fix the server side.
On the server:
Add the JSON middleware to your express server so it can receive JSON POST body data
Update /quote_search to be a POST route
Get the search string from the POST body, replacing fakestring