This example demonstrates how shared chains helps standardize both request and response handling while letting each API define its own behavior. A chain groups plugins and interceptors into reusable components, significantly reducing redundancy and the overall size of your configuration, especially when managing multiple APIs.
- Start the Router
./router-service.sh # Linux/Mac router-service.bat # Windows
- Test the APIs:
- API 1:
Observe the gateway log output for 'Path: ...'
curl -i http://localhost:2000/foo
- API 2:
Observe the gateway output and the response HTTP headers
curl -i http://localhost:2000/bar
- API 1:
- Check
apis.yamlto see how chains are applied.