- Under
server/api/controllersadd a newinsurances.jscontroller. You can simply copyhello_world.jsas a template, if you like. - Add a first endpoint to that controller:
POST /insurancesthat receives an insurance request. Store the data you receive in-memory in a list. The data should be of the form (e.g.):
{
"insuranceType": "property",
"provider": "Capitol Versicherung AG"
}- Add a second endpoint to that controller:
GET /insurancesthat returns the insurances stored in-memory.
- Keep in mind that we use OAS 2.0 with node swagger package (not the newer version 3.0!)
- Don't forget to save your swagger.yaml file frequently to disk (!!)
- Start the server with
DEBUG=swagger-tools* swagger project startfor debugging - To set up the controller
- To edit swagger.yaml