A example implementation of a Common Gateway configuration for generating an API. This example has been specifically setup to use as a temple, read more about that under [Using this repositry as a temple](#Using this repositry as a temple).
Read more..
This Commmon Gateway configuration repository is bassed on petstore an example Open API Specification from our friends at redocly. In order to create and maintain Open Api Secifications files we recomend using stoplight, you can find the stoplight project for Pet Store here. For convience purpose a copy of the Pet strore oas is stored in this repository here.
The public code for this ropository was genereted trough the publiccode yaml editor.
You need Docker desktop if you want to use this API locally on the gateway. Once you have installed docker you need to go to the root of the project with a command line.
Then you can run the image with:
docker compose up
If the php container shows "Ready to handle connections" the gateway is ready. The API runs on port :80 and the endpoints of this API fall under /api
To run the API on a online gateway the helm secret PUBLICCODE must be set with the url to the raw publiccode.yaml, like: https://raw.githubusercontent.com/CommonGateway/PetStoreAPI/main/publiccode.yaml
If its properly set you can run the following command in a PHP pod:
bin/console app:load-publiccodes
The console should show if the API has been loaded successfully, and then you can make API requests to yourdomain/api.
On every commit github launches a action that generates a postman collection and tests the API. Its results can be viewed under Actions on the github page.