This repo provides a front end to be used with this backend repo. Fork and clone this repository, and check out the client-side application with open index.html
- Clone down backend repo in a directory on the same level as this one i.e. both the frontend and backend repo should be in the same folder, not within one or the other.
cd
into the cloned backend repo repo- Run
npm install
- Run
npm start
to start the backend server. The server should be running locally onhttp://localhost:3001
. (Note: If you navigate tohttp://localhost:3001/
in your browser, you will see a screen that saysCannot GET /
, which is to be expected. Follow the next step to see more useful information.) - Navigate to an endpoint you're trying to request in the browser (for example, if you want to GET users, navigate to http://localhost:3001/api/v1/death-valley in the browser) - see the tables below for possible endpoints.
Available locations: death-valley
, mawsynram
, denali
url | verb | req. body |
---|---|---|
http://localhost:3001/api/v1/${location} |
GET | |
http://localhost:3001/api/v1/${location} |
POST | { message: <String> } |
http://localhost:3001/api/v1/${location} |
DELETE |
- Make 7 day forecast appear on the dom
- Implement populateHeader and populateAlertMessage functions
- Implement postNewAlert function
- Add error handling that will not POST an empty message
- Create a function that will delete any current alerts
- Add error handling that will not delete an alert if there is no alert to delete
- SPICY: Create a closure that takes in our API base URL (OR request method) and saves that value for later, resulting in a function we call with our location only (fetch function w/ base URL (OR request method) is partially applied)
- When and where can I update the DOM based on async data responses?
- How can stale data on the DOM from previous network requests be cleared off the display?
- How do we ensure data remains up to date on the DOM when POST and DELETE requests happen?
- How can global variables be leveraged to store the value of async data?
- How can network request error handling be employed to let the user know they've done something wrong?
- How can we indicate to users that data is still loading?