Now that the client can make requests to the server, it's time to add some functions to request events. The server has made available a GET endpoint for /api/v1/events which will return a json array of events.
This function should use the Fetch API to make requests to the server, and then return an array of events. For the scope of this issue, just make the request and then print the result to the console. We'll handle displaying the events in a separate issue.
Definition of Done:
Make a GET request to the server for the list of events
The result should fit into an array of events defined on the client
Now that the client can make requests to the server, it's time to add some functions to request events. The server has made available a
GET
endpoint for/api/v1/events
which will return a json array of events.This function should use the Fetch API to make requests to the server, and then return an array of events. For the scope of this issue, just make the request and then print the result to the console. We'll handle displaying the events in a separate issue.
Definition of Done:
GET
request to the server for the list of events