- Install consul.
- Clone code to your local computer.
- Execute command
consul agent -dev -config-dir=consul.d
under theOcelot.Demo\Ocelot.ApiGateways
folder. After that visist the http://localhost:8500/ui to go to consul dashboard. - Start
Ocelot.Identity.Api
(6003),Ocelot.ApiGateways
(60000),Ocelot.Catalog.Api
(6002) andOcelot.Basket.Api
(6001) withdotnet run
command. - Use postman to post a request with the following parameters to
localhost:6003/connect/token
to get bearer token. (content-type:application/x-www-form-urlencoded)
client_id:client
client_secret:secret
grant_type:client_credentials
- Use postman to visist the
localhost:60000/index
with the token for testing Ocelot request aggregate.
Authorization:Bearer {token}
- Use postman to send a request to
localhost:60000/admin/configuration
for getting or modifying ocelot configuration at runtime. (First of all, you must get bearer token withclient_id:ocelot.admin,client_secret:secret
and then use the token to send request. Just reference step 4, step 5.)
For more detail visis :