You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a discussion about the requirements of the first page we'd like to implement: the API status page.
Goal
Create a page to monitor the status of all the APIs we connect in Best of JavaScript, and especially the API we created.
We want to know:
if the API is online (does it respond with a 200 status)
how much time it takes to respond
how much data it returns (the size)
We'd like to check the JSON content returned by the API end-point.
In this first iteration, no backend is required, it would be a "real time check" every time the user opens the page.
How it could look like
The page could display several cards, every card would show the status of a given end-point.
The card would display:
The status online / error
The response time
The size of data returned
Data returned by the payload (maybe inside an expandable section, collapsed by default):
Raw data (JSON or HTML)
Formatted Data (JSON with syntax highlighted or HTML preview)
There would be a way to refresh data for any card.
We could use a timer to refresh data after every seconds.
Optional: the card could store in its local state the history of every request, so that we compare the results of the last N requests triggered since the page was opened.
Components
We could use a stateful component <FetchStatus> to fetch data about the status for a given URL , using the "render prop" pattern.
A better way to monitor your API's and site click flows
Seamlessly monitor the performance and correctness of your API endpoints and vital site transactions from a single dashboard."
This issue is a discussion about the requirements of the first page we'd like to implement: the API status page.
Goal
Create a page to monitor the status of all the APIs we connect in Best of JavaScript, and especially the API we created.
We want to know:
200
status)We'd like to check the JSON content returned by the API end-point.
In this first iteration, no backend is required, it would be a "real time check" every time the user opens the page.
How it could look like
The page could display several cards, every card would show the status of a given end-point.
The card would display:
There would be a way to refresh data for any card.
We could use a timer to refresh data after every seconds.
Optional: the card could store in its local state the history of every request, so that we compare the results of the last N requests triggered since the page was opened.
Components
We could use a stateful component
<FetchStatus>
to fetch data about the status for a given URL , using the "render prop" pattern.It could use, under the hood, this component: https://github.com/ghengeveld/react-async that has interesting features:
startedAt
andfinishedAt
dates (useful to compute the response time)cancel
andreload
actionTo render the status of a given API end-point, we could create stateful
<Status />
componentAPI URLs
Most of the URLs return JSON data, except
get-github-readme-v2
URL that returns HTML.The text was updated successfully, but these errors were encountered: