An hands-on lab about Microcks and Apicurio
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
dependabot[bot] 409a1d645c
Bump express from 4.17.1 to 4.18.2 in /api-backend/nodejs
3 years ago
..
.gitignore first commit 6 years ago
README.md update doc 6 years ago
package-lock.json Bump express from 4.17.1 to 4.18.2 in /api-backend/nodejs 3 years ago
package.json Bump underscore from 1.9.1 to 1.12.1 in /api-backend/nodejs 5 years ago
server.js fix error structure 6 years ago

README.md

Petstore API

Deploy

oc new-project petstore-api --display-name="Petstore API"
oc new-app --name=petstore-api openshift/nodejs~https://github.com/nmasse-itix/microcks-workshop.git --context-dir=api-backend/nodejs/
oc expose svc/petstore-api --hostname=petstore-api.app.itix.fr
oc new-app --name=petstore-api-fixed openshift/nodejs~https://github.com/nmasse-itix/microcks-workshop.git --context-dir=api-backend/nodejs/ -e RETURN_200_ON_CREATE=true
oc expose svc/petstore-api-fixed --hostname=petstore-api-fixed.app.itix.fr

Usage

List all pets

curl http://localhost:8080/pets/

Get a pet

curl http://localhost:8080/pets/1
curl http://localhost:8080/pets/2

Create a pet

curl -XPOST http://localhost:8080/pets/ -H 'Content-Type: application/json' -d '{"name":"Raspoutine","tag":"dog"}'

Update a pet

curl -XPUT http://localhost:8080/pets/3 -H 'Content-Type: application/json' -d '{"id":3,"name":"Daisy","tag":"turtle"}'

Delete a pet

curl -XDELETE http://localhost:8080/pets/3