Huwelijksplanner / TrouwService

Trouwservice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouw Service

Automated Testing

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).

About Trouw Service

Running the API locally

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

Running the API online

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/Huwelijksplanner/TrouwService/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.

(Unit) Testing the 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.

Make sure that in your OAS definition there is a localhost server defined like:

servers:
 - url: localhost/api

About

Trouwservice