We have:
-
An API gateway listening at http://localhost:7000
-
The routing is defined in the file
ocelot.json
in theApiGateway
project -
An application management microservice listening at
http://application-management:6000
with the following endpoints-
/api/applications
-
/api/applications/{applicationId}
-
-
A programs selection microservice listening at
http://product-selection:5000
with the following endpoints-
/api/programs
-
/api/programs/{programId}
-
-
The API Gateway reroutes requests:
-
to
/applications
and/applications/{applicationId}
to the application management microservice -
to
/programs
and/programs/{programId}
to the programs selection microservice
-
-
Navigate to this solution folder
-
Execute the following command to run the application:
docker-compose up -d --build
-
Double check that the app is up and running:
docker-compose ps
-
Open another terminal window and navigate to this solution folder
-
Follow the logs of the
gateway
component:docker-compose logs -f gateway
-
Open another terminal window
-
Make sure that the gateway is responding:
curl http://localhost:7000/api/values
it should reply with:
value1, value2
-
Try to access the
applications
andprograms
in their respective microservice:# this will be re-routed to http://application-management:6000/api/applications curl http://localhost:7000/applications # this will be re-routed to http://program-selection:5000/api/programs curl http://localhost:7000/programs
-
Also try to get a single application or program:
curl http://localhost:7000/applications/12 curl http://localhost:7000/programs/5