scripttag in the HTML response. The
srcattribute triggers a GET request.
/ha. The server sends back a JSON response.
createdbwith the DB name in config/config.js
http://localhost:3004/itemsin the browser to verify the server is set up and the browser can receive items in the response.
scripttag to the view page to import Axios.
console.logon line 6. Our starter code is sending back data from the server here: https://github.com/rocketacademy/ajax-bootcamp/blob/main/controllers/items.mjs#L5 When the browser gets to line 6 we have access to the data sent back from the server.
console.logon line 6 in
console.logonly the name of the first item in the response.
script.js, manipulate the DOM to show all items in the HTML page.
script.jssuch that the above AJAX request and DOM manipulation happens when we click the button.