Some functionalities, such as authentication and rate limiting, are required across all APIs, not just individually. By adding plugins to the global interceptor chain rather than configuring them for each API separately, these functionalities become universally active for all APIs. Global interceptors ensure consistent behavior, eliminate redundancy, and simplify configuration.
- Start the Router
./router-service.sh # Linux/Mac router-service.bat # Windows
- Test the APIs:
- API 1 (Port 2000) → Returns
200 OKcurl -i http://localhost:2000/foo
- API 2 (Port 2001) → Returns
404 Not FoundCheck the request: both contain CORS headerscurl -i http://localhost:2001/bar
- API 1 (Port 2000) → Returns
- Check
apis.yamlto see how the global interceptors are applied.