After you complete the previous steps, run the make run command from the policy’s root directory to deploy policy:
This command starts the two Docker containers in the <root-directory>/playground/docker-compose.yaml file:
-
Local-flex: The Omni Gateway instance Docker container that executes the custom policy. This Omni Gateway listens for requests made to localhost:8081.
-
Backend: The Docker Container that runs the backend service for the Omni Gateway instance. This backend service echoes any request it receives.
|
|
To stop the Docker containers, press Cmd+c or Ctrl+c depending on your device from the terminal running the containers.
|
Once the containers are running, you can make requests to the API instance, for example:
curl --location --request POST 'http://0.0.0.0:8081/some/route' \
--header 'Token: mytoken'
The backend service returns an echo response including the requests’s route, body, and headers sent with any modification performed by the custom policy or additional policies. Any logs included in the custom policy’s source code are visible in the terminal running the containers.