Add API key authentication to your Echo API routes
This project demonstrates the usage of Unkey-Echo middleware for handling API requests.
Create a .env
file in the root directory with the following variables:
1UNKEY_ROOT_KEY=<Your root key from app.unkey.com/settings/root-keys>2UNKEY_API_ID=<Your Project API ID>
This middleware handles any request thrown to the server.
To use the API, make a GET request to the server with an Authorization header containing your API key:
1curl -X GET \2 http://localhost:8080/ \3 -H 'Authorization: key_your_api_key'
Replace key_your_api_key
with your actual API key.
Ensure that your server is running on localhost:8080
or update the URL in the curl command accordingly.
2500 verifications and 100K successful rate‑limited requests per month. No CC required.