Provide students with HTML and JavaScript. JavaScript will include AJAX calls to a CRUD-capable server (students will create server and database code).
Add the following routes. Do them in the suggested order below.
GET /treats
returns a list of potential treats (e.g. cupcakes, goldfish, etc) and their image URLs.POST /treats
expects a treat description and link to a url image.
GET requests can pass some data to the server as part of the URL (ex. see below /treats?q=donut
. This stack overflow link was useful to see where the this data is stored on the express request object: GET parameters after q.
GET /treats?q=donut
should return only treats that match the query parameter
- Fork and clone this repository.
- Take some time to look at the given code. What code is needed and what will be removed once the server side code is generated?
- Design and create the database. Be sure to commit the create table syntax in the
create_database.sql
file. - Build out the server routes described above.
- Remove HTML that will be generated via AJAX calls once server-side has been tested.