This lambda is used to cache the status of checkly services. This is useful as the checkly API is slow, has API keys and has a requests limit.
By using this lambda and vercel we can cache the status of the services and use them in the frontend.
We use stale-while-revalidate
to cache the status for 10 seconds, and still serve the stale data when refetching the cache. To learn more about stale-while-revalidate, see vercel docs.
Feel free to use the hosted endpoint of this lambda in your dapp:
GET https://starknet-status.vercel.app/api/status
If you want to develop this lambda locally, you can use:
npx vercel dev
For further informations about this command, see vercel docs.
Vercel will ask you to input the required environment variables ENDPOINT
and HEADERS
ENDPOINT:
https://api.checklyhq.com/v1/check-statusesHEADERS:
{"Authorization": "Bearer API_KEY_HERE", "X-Checkly-Account": "ACCOUNT_ID_HERE"}