-
Install node (if needed).
-
Install npm (if needed).
-
Install project prerequisites. From the samples/training directory execute:
npm install
-
Start Redis:
redis-server
-
Execute:
npm run cache
-
Try it:
curl http://localhost:8012/test
-
Try it several times fast. Note some requests will be answered from the proxy's cache.
-
Execute:
npm run quota
-
Try it:
curl http://localhost:8012/test
-
Try it several times. Note the proxy will only allow 2 requests per minute to each URL.
-
Execute:
npm run oauth-endpoints
-
Try some of the commands printed on the console.
-
Try this (it should fail):
curl -H "Authorization: Bearer TOKEN" http://localhost:8012/protected
-
Try replacing TOKEN with a token you've created. It should work now.
-
Execute:
npm run oauth
-
Try this (it should fail):
curl -H "Authorization: Bearer TOKEN" http://localhost:8012/protected
-
Try replacing TOKEN with a token you created above. The proxy should forward the request now.
- Create an Apigee Edge account and deploy the Apigee Remote Proxy.
- Copy config/apigee-example.js to config/apigee.js
- Put your correct configuration values into config/apigee.js.
-
Change the bottom section of config/volos.js to replace "default: redis" with "default: apigee" like so:
module.exports = { memory: memory, redis: redis, apigee: apigee, default: apigee };
Try the same tests as described for Redis above.
- Try tweaking the examples
- Try putting cache, quota, or oauth authentication on a specific endpoint
- Try combining cache, quota, and oauth on endpoints
Have fun!